klizmillares commited on
Commit
4fad43f
·
verified ·
1 Parent(s): b43b6c8
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -15,7 +15,7 @@ def caption_image(input_image: np.ndarray):
15
  inputs = processor(raw_image, return_tensors="pt")
16
 
17
  # Generate a caption for the image
18
- out = model.generate(**inputs,max_length=50)
19
 
20
  # Decode the generated tokens to text
21
  caption = processor.decode(out[0], skip_special_tokens=True)
@@ -26,8 +26,8 @@ iface = gr.Interface(
26
  fn=caption_image,
27
  inputs=gr.Image(),
28
  outputs="text",
29
- title="Image Captioning Kliz Millares",
30
- description="This is a simple web app for generating captions for images using a trained model."
31
  )
32
 
33
- iface.launch()
 
15
  inputs = processor(raw_image, return_tensors="pt")
16
 
17
  # Generate a caption for the image
18
+ out = model.generate(**inputs, max_length=50)
19
 
20
  # Decode the generated tokens to text
21
  caption = processor.decode(out[0], skip_special_tokens=True)
 
26
  fn=caption_image,
27
  inputs=gr.Image(),
28
  outputs="text",
29
+ title="Image Captioning - Kliz Andrei Millares",
30
+ description="Generate descriptive captions for your images using the BLIP model, brought to you by Kliz Andrei Millares™."
31
  )
32
 
33
+ iface.launch()