prthm11 commited on
Commit
f16292f
·
verified ·
1 Parent(s): 5bc11ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -890,7 +890,13 @@ def similarity_matching(input_json_path: str, project_folder:str) -> str:
890
  b64 = b64.split(",", 1)[1]
891
  img_bytes = base64.b64decode(b64)
892
  pil_img = Image.open(BytesIO(img_bytes)).convert("RGB")
893
- feats = clip_embd.embed_image([pil_img])
 
 
 
 
 
 
894
  feats = feats_list[0]
895
  sprite_features.append(feats)
896
 
 
890
  b64 = b64.split(",", 1)[1]
891
  img_bytes = base64.b64decode(b64)
892
  pil_img = Image.open(BytesIO(img_bytes)).convert("RGB")
893
+
894
+ buf = BytesIO()
895
+ pil_img.save(buf, format="PNG")
896
+ buf.seek(0)
897
+
898
+ # 4) pass the buffer inside a list
899
+ feats_list = clip_embd.embed_image([buf])
900
  feats = feats_list[0]
901
  sprite_features.append(feats)
902