kartikay24 commited on
Commit
d8c1fe5
·
1 Parent(s): edc630c

Provided Conditional Examples

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -32,6 +32,9 @@ input_image = gr.inputs.Image(label="Upload an Image")
32
  input_text = gr.inputs.Textbox(label="Enter Text (for Conditional Captioning)")
33
  radio_button = gr.inputs.Radio(choices=["Conditional", "Unconditional"], label="Captioning Type")
34
  output_text = gr.outputs.Textbox(label="Caption")
35
- examples = [[f"Image{i}.png" ] + ["Unconditional", ""] for i in range(1, 4)]
 
 
 
36
 
37
- gr.Interface(fn=generate_caption, inputs=[input_image, radio_button, input_text], outputs=output_text, examples = examples, title="Image Captioning", description = "Model was taken from https://huggingface.co/Salesforce/blip-image-captioning-base").launch()
 
32
  input_text = gr.inputs.Textbox(label="Enter Text (for Conditional Captioning)")
33
  radio_button = gr.inputs.Radio(choices=["Conditional", "Unconditional"], label="Captioning Type")
34
  output_text = gr.outputs.Textbox(label="Caption")
35
+ #examples = [[f"Image{i}.png" ] + ["Unconditional", ""] for i in range(1, 4)]
36
+ examples = [["Image1.png","Conditional", "Goal"],
37
+ ["Image2.png","Unconditional", ""],
38
+ ["Image3.png","Conditional", "Watch"]]
39
 
40
+ gr.Interface(fn=generate_caption, inputs=[input_image, radio_button, input_text], outputs=output_text, examples = examples, title="Image Captioning", description = "Model was taken from https://huggingface.co/Salesforce/blip-image-captioning-base.You can provide words as conditions to give a direction to your caption.You can refer to the examples below.").launch()