Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,9 +28,9 @@ def analyze_images(image_a, image_b):
|
|
| 28 |
features = clip_model.get_image_features(**inputs)
|
| 29 |
return features.detach().numpy()
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
img_a =
|
| 33 |
-
img_b =
|
| 34 |
|
| 35 |
# 生成描述
|
| 36 |
caption_a = generate_caption(img_a)
|
|
|
|
| 28 |
features = clip_model.get_image_features(**inputs)
|
| 29 |
return features.detach().numpy()
|
| 30 |
|
| 31 |
+
# 图像已经是 PIL.Image 对象,直接处理
|
| 32 |
+
img_a = image_a.convert("RGB")
|
| 33 |
+
img_b = image_b.convert("RGB")
|
| 34 |
|
| 35 |
# 生成描述
|
| 36 |
caption_a = generate_caption(img_a)
|