File size: 1,078 Bytes
b3f9595
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
title = "OctoBERT"
description = """Interactive Demo for OctoBERT. This base model is trained only on Flickr-30k."""
examples =[
['swing.jpg','The woman stands outdoors, next to a child in a <mask>.'],
['tennis.jpg', 'A woman in blue shorts and white shirt holds a tennis racket on a blue <mask> court.'],
['birthday.jpg', 'The smiling <mask> is celebrating her <mask> party with friends, surrounded by balloons and a <mask> with candles.'],
['skate.jpg', 'A person in a rainbow colored snowsuit is snowboarding down a <mask> slope.'],
['street.jpg', 'A man with <mask> plays with a little girl while walking down the street, while an Asian woman walks ahead of them.'],
['dog.jpg', 'A black dog stands on a <mask>, green fields behind him.'],
]
gr.Interface(
    plot_inference, 
    [gr.inputs.Image(type="pil", label="Input"), gr.inputs.Textbox(label="input text")], 
    [gr.outputs.Image(type="file", label="Output"), gr.outputs.Textbox(label="Predicted Words")],
    title=title,
    description=description,
    examples=examples,
    cache_examples=False,
    ).launch()