Spaces:
Runtime error
Runtime error
Commit
·
7b8c02f
1
Parent(s):
af0c9d9
Update main.py
Browse files
main.py
CHANGED
|
@@ -43,7 +43,7 @@ def predict(item: Item):
|
|
| 43 |
opened_images = [Image.open(image_stream) for image_stream in image_streams]
|
| 44 |
|
| 45 |
# Assuming 'model' is your pre-trained model that encodes the images
|
| 46 |
-
|
| 47 |
|
| 48 |
# Now we run the clustering algorithm. This function compares images aganist
|
| 49 |
# all other images and returns a list with the pairs that have the highest
|
|
|
|
| 43 |
opened_images = [Image.open(image_stream) for image_stream in image_streams]
|
| 44 |
|
| 45 |
# Assuming 'model' is your pre-trained model that encodes the images
|
| 46 |
+
encoded_image = model.encode(opened_images, batch_size=128, convert_to_tensor=True, show_progress_bar=True)
|
| 47 |
|
| 48 |
# Now we run the clustering algorithm. This function compares images aganist
|
| 49 |
# all other images and returns a list with the pairs that have the highest
|