Commit
·
556db9d
1
Parent(s):
cf12135
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,12 +12,13 @@ def generate_caption(image,length):
|
|
| 12 |
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 13 |
return generated_caption
|
| 14 |
demo=gr.Interface(
|
| 15 |
-
generate_caption,
|
| 16 |
-
[
|
| 17 |
gr.Image(type='pil',flagging_options=["blurry", "incorrect", "other"]),
|
| 18 |
gr.Slider(10,50,value=10)
|
| 19 |
],
|
| 20 |
-
|
|
|
|
| 21 |
theme=gr.themes.Soft(primary_hue='purple',secondary_hue=gr.themes.colors.gray)
|
| 22 |
)
|
| 23 |
demo.launch(show_error=True)
|
|
|
|
| 12 |
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 13 |
return generated_caption
|
| 14 |
demo=gr.Interface(
|
| 15 |
+
fn=generate_caption,
|
| 16 |
+
inputs=[
|
| 17 |
gr.Image(type='pil',flagging_options=["blurry", "incorrect", "other"]),
|
| 18 |
gr.Slider(10,50,value=10)
|
| 19 |
],
|
| 20 |
+
outputs= 'label',
|
| 21 |
+
examples=["sample.jpg","sample1.jpg","sample2.jpg","sample3.jpg","sample4.jpg"]
|
| 22 |
theme=gr.themes.Soft(primary_hue='purple',secondary_hue=gr.themes.colors.gray)
|
| 23 |
)
|
| 24 |
demo.launch(show_error=True)
|