Instructions to use nmndeep/CLIC-ViT-L-14-224-PixPr-RedCaps with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- OpenCLIP
How to use nmndeep/CLIC-ViT-L-14-224-PixPr-RedCaps with OpenCLIP:
import open_clip model, preprocess_train, preprocess_val = open_clip.create_model_and_transforms('hf-hub:nmndeep/CLIC-ViT-L-14-224-PixPr-RedCaps') tokenizer = open_clip.get_tokenizer('hf-hub:nmndeep/CLIC-ViT-L-14-224-PixPr-RedCaps') - Notebooks
- Google Colab
- Kaggle
Improve model card: Add metadata, external links, and fix sample usage
Browse filesThis PR enhances the model card for `nmndeep/CLIC-ViT-L-14-224-PixPr-RedCaps` by adding crucial information and ensuring the sample usage is runnable.
Specifically, it:
- Adds `license: apache-2.0`.
- Sets the `pipeline_tag` to `zero-shot-image-classification` for better discoverability on the Hub.
- Specifies `library_name: open_clip`, which enables the automated "How to use" widget on the model page.
- Adds links to the official paper ([Advancing Compositional Awareness in CLIP with Efficient Fine-Tuning](https://huggingface.co/papers/2505.24424)), the project page (`https://clic-compositional-clip.github.io/`), and the GitHub repository (`https://github.com/AmitPeleg/CLIC`).
- Corrects the sample usage code snippet by adding the necessary `from urllib.request import urlopen` import, making it fully runnable.
|
@@ -1,19 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
# Model Card for CLIC-ViT-L-14-224-PixPr-RedCaps
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
|
| 8 |
-
- **
|
| 9 |
|
| 10 |
## Model Usage
|
| 11 |
### With OpenCLIP
|
| 12 |
|
| 13 |
-
```
|
| 14 |
import torch
|
| 15 |
from PIL import Image
|
| 16 |
import open_clip
|
|
|
|
|
|
|
| 17 |
|
| 18 |
model, _, image_processor = open_clip.create_model_and_transforms('hf-hub:nmndeep/CLIC-ViT-L-14-224-PixPr-RedCaps')
|
| 19 |
|
|
@@ -39,4 +49,4 @@ with torch.no_grad(), torch.autocast("cuda"):
|
|
| 39 |
text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)
|
| 40 |
idx = torch.argmax(text_probs)
|
| 41 |
print("Output label:", texts[idx])
|
| 42 |
-
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
pipeline_tag: zero-shot-image-classification
|
| 4 |
+
library_name: open_clip
|
| 5 |
+
---
|
| 6 |
|
| 7 |
# Model Card for CLIC-ViT-L-14-224-PixPr-RedCaps
|
| 8 |
|
| 9 |
+
This model is presented in the paper [Advancing Compositional Awareness in CLIP with Efficient Fine-Tuning](https://huggingface.co/papers/2505.24424).
|
| 10 |
+
|
| 11 |
+
Project Page: https://clic-compositional-clip.github.io/
|
| 12 |
+
Code: https://github.com/AmitPeleg/CLIC
|
| 13 |
|
| 14 |
+
## Model Details
|
| 15 |
|
| 16 |
+
- **Description**: Fine-tuned with CLIC using the RedCaps subset of the PixelProse dataset.
|
| 17 |
|
| 18 |
## Model Usage
|
| 19 |
### With OpenCLIP
|
| 20 |
|
| 21 |
+
```python
|
| 22 |
import torch
|
| 23 |
from PIL import Image
|
| 24 |
import open_clip
|
| 25 |
+
from urllib.request import urlopen # Added for urlopen
|
| 26 |
+
|
| 27 |
|
| 28 |
model, _, image_processor = open_clip.create_model_and_transforms('hf-hub:nmndeep/CLIC-ViT-L-14-224-PixPr-RedCaps')
|
| 29 |
|
|
|
|
| 49 |
text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)
|
| 50 |
idx = torch.argmax(text_probs)
|
| 51 |
print("Output label:", texts[idx])
|
| 52 |
+
```
|