Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,13 +8,12 @@ def get_image_embedding(image):
|
|
| 8 |
image_model = SentenceTransformer('clip-ViT-B-32')
|
| 9 |
|
| 10 |
# Load and preprocess the image
|
| 11 |
-
image = Image.open(image)
|
| 12 |
img_emb = image_model.encode(image)
|
| 13 |
|
| 14 |
return {"prediction": img_emb}
|
| 15 |
|
| 16 |
|
| 17 |
-
image_input = gr.
|
| 18 |
label_output = gr.outputs.Label()
|
| 19 |
|
| 20 |
gr.Interface(fn=get_image_embedding, inputs=image_input, outputs=label_output).launch()
|
|
|
|
| 8 |
image_model = SentenceTransformer('clip-ViT-B-32')
|
| 9 |
|
| 10 |
# Load and preprocess the image
|
|
|
|
| 11 |
img_emb = image_model.encode(image)
|
| 12 |
|
| 13 |
return {"prediction": img_emb}
|
| 14 |
|
| 15 |
|
| 16 |
+
image_input = gr.Image(type="pil")
|
| 17 |
label_output = gr.outputs.Label()
|
| 18 |
|
| 19 |
gr.Interface(fn=get_image_embedding, inputs=image_input, outputs=label_output).launch()
|