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", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| """ | |
| GAP-CLIP: Guaranteed Attribute Positioning in CLIP Embeddings | |
| ============================================================== | |
| A multimodal fashion search model that combines color embeddings, | |
| hierarchical category embeddings, and general CLIP capabilities. | |
| Main Components: | |
| - ColorCLIP: Specialized color embedding model (16 dims) | |
| - HierarchyModel: Category classification model (64 dims) | |
| - GAP-CLIP: Main CLIP model with aligned subspaces (512 dims) | |
| Quick Start: | |
| >>> from gap_clip import load_models_from_hf | |
| >>> models = load_models_from_hf("Leacb4/gap-clip") | |
| >>> # Use models for search... | |
| For more information, see the README.md file or visit: | |
| https://huggingface.co/Leacb4/gap-clip | |
| """ | |
| __version__ = "1.0.0" | |
| __author__ = "Lea Attia Sarfati" | |
| __email__ = "lea.attia@gmail.com" | |
| # Import main components for easy access | |
| try: | |
| from .training.color_model import ColorCLIP | |
| from .training.hierarchy_model import HierarchyModel, HierarchyExtractor | |
| from .example_usage import ( | |
| load_gap_clip, get_image_embedding_from_url, get_text_embedding, | |
| load_models_from_hf, load_models_from_local, example_search, | |
| ) | |
| from . import config | |
| __all__ = [ | |
| 'ColorCLIP', | |
| 'HierarchyModel', | |
| 'HierarchyExtractor', | |
| 'load_gap_clip', | |
| 'get_image_embedding_from_url', | |
| 'get_text_embedding', | |
| 'load_models_from_hf', | |
| 'load_models_from_local', | |
| 'example_search', | |
| 'config', | |
| '__version__', | |
| ] | |
| except ImportError: | |
| # If imports fail, it's ok - the package can still be used | |
| __all__ = ['__version__'] | |