Commit ·
9646a58
1
Parent(s): c831efa
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ def generate_caption(image_file):
|
|
| 13 |
|
| 14 |
|
| 15 |
# Preprocess the image using the Blip-Caption model's visual processors
|
| 16 |
-
image = vis_processors["eval"](
|
| 17 |
|
| 18 |
# Generate captions using the Blip-Caption model
|
| 19 |
captions = model.generate({"image": image}, use_nucleus_sampling=True, num_captions=5)
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
# Preprocess the image using the Blip-Caption model's visual processors
|
| 16 |
+
image = vis_processors["eval"](image_file).unsqueeze(0)
|
| 17 |
|
| 18 |
# Generate captions using the Blip-Caption model
|
| 19 |
captions = model.generate({"image": image}, use_nucleus_sampling=True, num_captions=5)
|