Update README.md
Browse files
README.md
CHANGED
@@ -111,4 +111,15 @@ text_embedding = text_encoder(**tokenizer(text,
|
|
111 |
return_tensors='pt')).pooler_output
|
112 |
image_embedding = vision_encoder(**preprocessor(image,
|
113 |
return_tensors='pt')).pooler_output
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
```
|
|
|
111 |
return_tensors='pt')).pooler_output
|
112 |
image_embedding = vision_encoder(**preprocessor(image,
|
113 |
return_tensors='pt')).pooler_output
|
114 |
+
```
|
115 |
+
|
116 |
+
### Demo:
|
117 |
+
The followings are just some use cases of CLIPfa on 25K Unsplash images
|
118 |
+
|
119 |
+
* use pip install -q git+https://github.com/sajjjadayobi/clipfa.git
|
120 |
+
```python
|
121 |
+
from clipfa import CLIPDemo
|
122 |
+
demo = CLIPDemo(vision_encoder, text_encoder, tokenizer)
|
123 |
+
demo.compute_text_embeddings(['گاو' ,'اسب' ,'ماهی'])
|
124 |
+
demo.compute_image_embeddings(test_df.image_path.to_list())
|
125 |
```
|