rorshark vit base
简介
核心亮点
- 基于 ViT 架构,具备强大的全局图像特征捕捉能力
- Apache-2.0 协议,支持商业化自由部署与二次开发
- 专注于图像分类任务,可作为高效的视觉特征提取器
- 模型规模适中,在推理速度与识别精度间取得平衡
使用方法
# 安装 Hugging Face transformers
pip install transformers torch
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("amunchet/rorshark-vit-base")
tokenizer = AutoTokenizer.from_pretrained("amunchet/rorshark-vit-base")
Hugging Face 下载
我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。
操作指引:在下载前,请先通过如下命令安装 huggingface_hub:
pip install -U huggingface_hub
命令行下载
下载完整模型库
huggingface-cli download amunchet/rorshark-vit-base
下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download amunchet/rorshark-vit-base config.json --local-dir ./dir
SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('amunchet/rorshark-vit-base')
Git 下载
请确保 lfs 已经被正确安装
git lfs install
git clone https://huggingface.co/amunchet/rorshark-vit-base
如果您希望跳过 lfs 大文件下载,可以使用如下命令
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/amunchet/rorshark-vit-base
模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。
PyTorch / Transformers 使用
安装 Transformers
pip install -U transformers torch
模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('amunchet/rorshark-vit-base')
tokenizer = AutoTokenizer.from_pretrained('amunchet/rorshark-vit-base')
完整文档
---
license: apache-2.0
base_model: google/vit-base-patch16-224-in21k
tags:
- image-classification
- vision
- generated_from_trainer
datasets:
- imagefolder
metrics:
- accuracy
model-index:
- name: rorshark-vit-base
results:
- task:
name: Image Classification
type: image-classification
dataset:
name: imagefolder
type: imagefolder
config: default
split: train
args: default
metrics:
- name: Accuracy
type: accuracy
value: 0.9922928709055877
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
rorshark-vit-base
This model is a fine-tuned version of google/vit-base-patch16-224-in21k on the imagefolder dataset.
It achieves the following results on the evaluation set:
- Loss: 0.0393
- Accuracy: 0.9923
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 1337
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 5.0
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|:-------------:|:-----:|:----:|:---------------:|:--------:|
| 0.0597 | 1.0 | 368 | 0.0546 | 0.9865 |
| 0.2009 | 2.0 | 736 | 0.0531 | 0.9865 |
| 0.0114 | 3.0 | 1104 | 0.0418 | 0.9904 |
| 0.0998 | 4.0 | 1472 | 0.0425 | 0.9904 |
| 0.1244 | 5.0 | 1840 | 0.0393 | 0.9923 |
Framework versions
- Transformers 4.36.0.dev0
- Pytorch 2.1.1+cu118
- Datasets 2.15.0
- Tokenizers 0.15.0