Spaces:
Sleeping
Sleeping
howard-hou
commited on
Commit
•
9a63af8
1
Parent(s):
922f821
Update app.py
Browse files
app.py
CHANGED
@@ -117,6 +117,7 @@ def get_image_features(image):
|
|
117 |
base64_image = pil_image_to_base64(image)
|
118 |
if base64_image in image_cache:
|
119 |
image_features = image_cache[base64_image]
|
|
|
120 |
else:
|
121 |
image = image_processor(images=image.convert('RGB'), return_tensors='pt')['pixel_values']
|
122 |
image_features = visual_encoder.encode_images(image.unsqueeze(0)).squeeze(0) # [L, D]
|
|
|
117 |
base64_image = pil_image_to_base64(image)
|
118 |
if base64_image in image_cache:
|
119 |
image_features = image_cache[base64_image]
|
120 |
+
print(f"use cache {base64_image[:10]}")
|
121 |
else:
|
122 |
image = image_processor(images=image.convert('RGB'), return_tensors='pt')['pixel_values']
|
123 |
image_features = visual_encoder.encode_images(image.unsqueeze(0)).squeeze(0) # [L, D]
|