indoflaven commited on
Commit
8182e16
·
1 Parent(s): e3758a0

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -1
main.py CHANGED
@@ -5,6 +5,7 @@ from typing import List
5
  class Item(BaseModel):
6
  name: str
7
  image1: bytes
 
8
 
9
  app = FastAPI()
10
 
@@ -28,7 +29,7 @@ def predict(Item):
28
  # encoded_image = model.encode(Image.open(filepath))
29
  #image_names = list(glob.glob('./*.jpg'))
30
  #print("Images:", len(image_names))
31
- encoded_image = model.encode(imageArray, batch_size=128, convert_to_tensor=True, show_progress_bar=True)
32
 
33
  # Now we run the clustering algorithm. This function compares images aganist
34
  # all other images and returns a list with the pairs that have the highest
 
5
  class Item(BaseModel):
6
  name: str
7
  image1: bytes
8
+ image2: bytes
9
 
10
  app = FastAPI()
11
 
 
29
  # encoded_image = model.encode(Image.open(filepath))
30
  #image_names = list(glob.glob('./*.jpg'))
31
  #print("Images:", len(image_names))
32
+ encoded_image = model.encode([Item.image1, Item.image2]], batch_size=128, convert_to_tensor=True, show_progress_bar=True)
33
 
34
  # Now we run the clustering algorithm. This function compares images aganist
35
  # all other images and returns a list with the pairs that have the highest