gschurck commited on
Commit
325991d
·
1 Parent(s): 64a3664

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
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.inputs.Image()
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()