Zero-Shot Image Classification
Transformers
Safetensors
English
clip
fashion
multimodal
image-search
text-search
embeddings
contrastive-learning
zero-shot-classification
Instructions to use Leacb4/gap-clip with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Leacb4/gap-clip with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-image-classification", model="Leacb4/gap-clip") 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, AutoModelForZeroShotImageClassification processor = AutoProcessor.from_pretrained("Leacb4/gap-clip") model = AutoModelForZeroShotImageClassification.from_pretrained("Leacb4/gap-clip") - Notebooks
- Google Colab
- Kaggle
| { | |
| "architectures": [ | |
| "CLIPModel" | |
| ], | |
| "dtype": "float32", | |
| "initializer_factor": 1.0, | |
| "logit_scale_init_value": 2.6592, | |
| "model_type": "clip", | |
| "projection_dim": 512, | |
| "text_config": { | |
| "attention_dropout": 0.0, | |
| "dropout": 0.0, | |
| "dtype": "float32", | |
| "hidden_act": "gelu", | |
| "hidden_size": 512, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 2048, | |
| "layer_norm_eps": 1e-05, | |
| "max_position_embeddings": 77, | |
| "model_type": "clip_text_model", | |
| "num_attention_heads": 8, | |
| "num_hidden_layers": 12, | |
| "projection_dim": 512, | |
| "vocab_size": 49408 | |
| }, | |
| "transformers_version": "4.57.1", | |
| "vision_config": { | |
| "attention_dropout": 0.0, | |
| "dropout": 0.0, | |
| "dtype": "float32", | |
| "hidden_act": "gelu", | |
| "hidden_size": 768, | |
| "image_size": 224, | |
| "initializer_factor": 1.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 3072, | |
| "layer_norm_eps": 1e-05, | |
| "model_type": "clip_vision_model", | |
| "num_attention_heads": 12, | |
| "num_channels": 3, | |
| "num_hidden_layers": 12, | |
| "patch_size": 32, | |
| "projection_dim": 512 | |
| } | |
| } | |