Instructions to use apple/MobileCLIP-S2-OpenCLIP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- OpenCLIP
How to use apple/MobileCLIP-S2-OpenCLIP with OpenCLIP:
import open_clip model, preprocess_train, preprocess_val = open_clip.create_model_and_transforms('hf-hub:apple/MobileCLIP-S2-OpenCLIP') tokenizer = open_clip.get_tokenizer('hf-hub:apple/MobileCLIP-S2-OpenCLIP') - Notebooks
- Google Colab
- Kaggle
| { | |
| "model_cfg": { | |
| "embed_dim": 512, | |
| "vision_cfg": { | |
| "timm_model_name": "fastvit_mci2", | |
| "timm_model_pretrained": false, | |
| "timm_pool": "avg", | |
| "timm_proj": null, | |
| "timm_drop": 0.0, | |
| "timm_drop_path": 0.0, | |
| "image_size": 256 | |
| }, | |
| "text_cfg": { | |
| "context_length": 77, | |
| "vocab_size": 49408, | |
| "width": 512, | |
| "heads": 8, | |
| "layers": 12, | |
| "no_causal_mask": true | |
| }, | |
| "custom_text": true | |
| }, | |
| "preprocess_cfg": { | |
| "mean": [ | |
| 0.0, | |
| 0.0, | |
| 0.0 | |
| ], | |
| "std": [ | |
| 1.0, | |
| 1.0, | |
| 1.0 | |
| ], | |
| "interpolation": "bilinear", | |
| "resize_mode": "shortest" | |
| } | |
| } |