fix input bugs
Browse files- .DS_Store +0 -0
- BLIP/.DS_Store +0 -0
- README.md +0 -13
- app.py +2 -2
- bike.jpg +0 -0
- surfer.jpg +0 -0
.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
BLIP/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: FuseCap
|
3 |
-
emoji: 📊
|
4 |
-
colorFrom: pink
|
5 |
-
colorTo: red
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.29.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
@@ -26,7 +26,7 @@ def inference(raw_image):
|
|
26 |
# raw_image = torch.tensor(raw_image)
|
27 |
image = transform(raw_image).unsqueeze(0).to(device)
|
28 |
with torch.no_grad():
|
29 |
-
caption = model.generate(image, sample=False, num_beams=
|
30 |
return caption[0]
|
31 |
|
32 |
|
@@ -34,7 +34,7 @@ inputs = [gr.Image(type='pil', interactive=False),]
|
|
34 |
outputs = gr.outputs.Textbox(label="Caption")
|
35 |
|
36 |
description = "Gradio demo for FuseCap: Leveraging Large Language Models to Fuse Visual Data into Enriched Image Captions. This demo features a BLIP-based model, trained using FuseCap."
|
37 |
-
examples = [["
|
38 |
article = "<p style='text-align: center'><a href='google.com' target='_blank'>place holder</a>"
|
39 |
|
40 |
|
|
|
26 |
# raw_image = torch.tensor(raw_image)
|
27 |
image = transform(raw_image).unsqueeze(0).to(device)
|
28 |
with torch.no_grad():
|
29 |
+
caption = model.generate(image, sample=False, num_beams=3, max_length=60, min_length=5)
|
30 |
return caption[0]
|
31 |
|
32 |
|
|
|
34 |
outputs = gr.outputs.Textbox(label="Caption")
|
35 |
|
36 |
description = "Gradio demo for FuseCap: Leveraging Large Language Models to Fuse Visual Data into Enriched Image Captions. This demo features a BLIP-based model, trained using FuseCap."
|
37 |
+
examples = [["surfer.jpg"], ["bike.jpg"]]
|
38 |
article = "<p style='text-align: center'><a href='google.com' target='_blank'>place holder</a>"
|
39 |
|
40 |
|
bike.jpg
CHANGED
surfer.jpg
CHANGED