Zero-Shot Image Classification
Transformers
JAX
Safetensors
MLX
PyTorch
aimv2
feature-extraction
vision
custom_code
Instructions to use apple/aimv2-large-patch14-224-lit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use apple/aimv2-large-patch14-224-lit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="apple/aimv2-large-patch14-224-lit", trust_remote_code=True) pipe( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png", candidate_labels=["animals", "humans", "landscape"], )# Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("apple/aimv2-large-patch14-224-lit", trust_remote_code=True) model = AutoModel.from_pretrained("apple/aimv2-large-patch14-224-lit", trust_remote_code=True, device_map="auto") - MLX
How to use apple/aimv2-large-patch14-224-lit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir aimv2-large-patch14-224-lit apple/aimv2-large-patch14-224-lit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
| { | |
| "architectures": [ | |
| "Aimv2Model" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_aimv2.AIMv2Config", | |
| "AutoModel": "modeling_aimv2.AIMv2Model" | |
| }, | |
| "init_temperature": 0.07, | |
| "logit_scale_init_value": 2.6592, | |
| "max_logit_scale": 100.0, | |
| "model_type": "aimv2", | |
| "projection_dim": 768, | |
| "text_config": { | |
| "attention_dropout": 0.0, | |
| "hidden_act": "silu", | |
| "hidden_size": 768, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 2048, | |
| "is_causal": true, | |
| "max_context_length": 77, | |
| "max_position_embeddings": 77, | |
| "mlp_bias": false, | |
| "model_type": "aimv2_text_model", | |
| "num_attention_heads": 6, | |
| "num_hidden_layers": 12, | |
| "projection_dropout": 0.0, | |
| "qkv_bias": false, | |
| "rms_norm_eps": 1e-05, | |
| "use_bias": false, | |
| "vocab_size": 49408 | |
| }, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.54.0.dev0", | |
| "vision_config": { | |
| "attention_dropout": 0.0, | |
| "hidden_act": "silu", | |
| "hidden_size": 1024, | |
| "image_size": 224, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 2816, | |
| "is_causal": false, | |
| "is_native": false, | |
| "mlp_bias": false, | |
| "model_type": "aimv2_vision_model", | |
| "num_attention_heads": 8, | |
| "num_channels": 3, | |
| "num_hidden_layers": 24, | |
| "num_queries": 1, | |
| "patch_size": 14, | |
| "projection_dropout": 0.0, | |
| "qkv_bias": false, | |
| "rms_norm_eps": 1e-05, | |
| "use_bias": false, | |
| "use_head": true | |
| } | |
| } | |