noamrot commited on
Commit
9578b89
1 Parent(s): 3407b67

fix input bugs

Browse files
Files changed (6) hide show
  1. .DS_Store +0 -0
  2. BLIP/.DS_Store +0 -0
  3. README.md +0 -13
  4. app.py +2 -2
  5. bike.jpg +0 -0
  6. 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=1, max_length=200, min_length=5)
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 = [["birthday_dog.jpeg"], ["surfer.jpg"], ["bike.jpg"]]
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