nielsr HF Staff commited on
Commit
082b506
·
verified ·
1 Parent(s): 4b10418

Improve model card: Add metadata, external links, and fix sample usage

Browse files

This 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.

Files changed (1) hide show
  1. README.md +15 -5
README.md CHANGED
@@ -1,19 +1,29 @@
 
 
 
 
 
1
 
2
  # Model Card for CLIC-ViT-L-14-224-PixPr-RedCaps
3
 
4
- ## Model Details
 
 
 
5
 
6
- <!-- Provide the basic links for the model. -->
7
 
8
- - **Model-details:** : Fine-tuned with CLIC using PixelProse dataset
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
+ ```