Feature Extraction
Transformers
clip
vision
Inference Endpoints
kimihailv commited on
Commit
c8b3cdd
1 Parent(s): 6502119

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -5
README.md CHANGED
@@ -60,12 +60,11 @@ from PIL import Image
60
  text = 'a small red panda in a zoo'
61
  image = Image.open('red_panda.jpg')
62
 
63
- image_data = model.preprocess_image(image)
64
- text_data = model.preprocess_text(text)
65
 
66
- image_embedding = model.encode_image(image_data)
67
- text_embedding = model.encode_text(text_data)
68
- joint_embedding = model.encode_multimodal(image=image_data, text=text_data)
69
  ```
70
 
71
  To get features:
 
60
  text = 'a small red panda in a zoo'
61
  image = Image.open('red_panda.jpg')
62
 
63
+ image_data = processor.preprocess_image(image)
64
+ text_data = processor.preprocess_text(text)
65
 
66
+ image_features, image_embedding = model.encode_image(image_data, return_features=True)
67
+ text_features, text_embedding = model.encode_text(text_data, return_features=True)
 
68
  ```
69
 
70
  To get features: