Instructions to use AFZAL0008/LeViT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AFZAL0008/LeViT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="AFZAL0008/LeViT") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("AFZAL0008/LeViT") model = AutoModelForImageClassification.from_pretrained("AFZAL0008/LeViT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 988 Bytes
c02ab41 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | {
"architectures": [
"LevitForImageClassification"
],
"attention_ratio": [
2,
2,
2
],
"depths": [
4,
4,
4
],
"down_ops": [
[
"Subsample",
32,
8,
4,
2,
2
],
[
"Subsample",
32,
12,
4,
2,
2
],
[
""
],
[
""
]
],
"drop_path_rate": 0,
"dtype": "float32",
"hidden_sizes": [
256,
384,
512
],
"id2label": {
"0": "eyelid",
"1": "normal"
},
"image_size": 224,
"initializer_range": 0.02,
"kernel_size": 3,
"key_dim": [
32,
32,
32
],
"label2id": {
"eyelid": 0,
"normal": 1
},
"mlp_ratio": [
2,
2,
2
],
"model_type": "levit",
"num_attention_heads": [
4,
6,
8
],
"num_channels": 3,
"padding": 1,
"patch_size": 16,
"problem_type": "single_label_classification",
"stride": 2,
"transformers_version": "5.22.1",
"use_cache": false
}
|