Instructions to use sgonzalez2000/dermai-vit-base-patch16-224 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sgonzalez2000/dermai-vit-base-patch16-224 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="sgonzalez2000/dermai-vit-base-patch16-224") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("sgonzalez2000/dermai-vit-base-patch16-224") model = AutoModelForImageClassification.from_pretrained("sgonzalez2000/dermai-vit-base-patch16-224", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- README.md +14 -0
- config.json +42 -0
- model.safetensors +3 -0
- preprocessor_config.json +22 -0
README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: google/vit-base-patch16-224
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- image-classification
|
| 6 |
+
- skin-lesion
|
| 7 |
+
- ham10000
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# dermai-vit-base-patch16-224
|
| 11 |
+
|
| 12 |
+
Fine-tuned [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) for 7-class
|
| 13 |
+
skin lesion classification on HAM10000. Part of the DermAI explainability
|
| 14 |
+
project comparing CNN and Vision Transformer explanations.
|
config.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"ViTForImageClassification"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.0,
|
| 6 |
+
"dtype": "float32",
|
| 7 |
+
"encoder_stride": 16,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.0,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "akiec",
|
| 13 |
+
"1": "bcc",
|
| 14 |
+
"2": "bkl",
|
| 15 |
+
"3": "df",
|
| 16 |
+
"4": "mel",
|
| 17 |
+
"5": "nv",
|
| 18 |
+
"6": "vasc"
|
| 19 |
+
},
|
| 20 |
+
"image_size": 224,
|
| 21 |
+
"initializer_range": 0.02,
|
| 22 |
+
"intermediate_size": 3072,
|
| 23 |
+
"label2id": {
|
| 24 |
+
"akiec": 0,
|
| 25 |
+
"bcc": 1,
|
| 26 |
+
"bkl": 2,
|
| 27 |
+
"df": 3,
|
| 28 |
+
"mel": 4,
|
| 29 |
+
"nv": 5,
|
| 30 |
+
"vasc": 6
|
| 31 |
+
},
|
| 32 |
+
"layer_norm_eps": 1e-12,
|
| 33 |
+
"model_type": "vit",
|
| 34 |
+
"num_attention_heads": 12,
|
| 35 |
+
"num_channels": 3,
|
| 36 |
+
"num_hidden_layers": 12,
|
| 37 |
+
"patch_size": 16,
|
| 38 |
+
"pooler_act": "tanh",
|
| 39 |
+
"pooler_output_size": 768,
|
| 40 |
+
"qkv_bias": true,
|
| 41 |
+
"transformers_version": "5.12.1"
|
| 42 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7cccaa9ef0376e9cb30fb07faf881d50491bdff5a206fe29190d6604056a2717
|
| 3 |
+
size 343239356
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_normalize": true,
|
| 3 |
+
"do_rescale": true,
|
| 4 |
+
"do_resize": true,
|
| 5 |
+
"image_mean": [
|
| 6 |
+
0.5,
|
| 7 |
+
0.5,
|
| 8 |
+
0.5
|
| 9 |
+
],
|
| 10 |
+
"image_processor_type": "ViTImageProcessor",
|
| 11 |
+
"image_std": [
|
| 12 |
+
0.5,
|
| 13 |
+
0.5,
|
| 14 |
+
0.5
|
| 15 |
+
],
|
| 16 |
+
"resample": 2,
|
| 17 |
+
"rescale_factor": 0.00392156862745098,
|
| 18 |
+
"size": {
|
| 19 |
+
"height": 224,
|
| 20 |
+
"width": 224
|
| 21 |
+
}
|
| 22 |
+
}
|