Spaces:
Sleeping
Sleeping
Commit ·
a09bc7c
1
Parent(s): 76b3196
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,8 +22,11 @@ model.eval()
|
|
| 22 |
def launch(input):
|
| 23 |
im=Image.open(requests.get(input,stream=True).raw)
|
| 24 |
image=transform(im.convert('RGB')).unsqueeze(0)
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
return
|
| 27 |
|
| 28 |
iface=gr.Interface(launch,inputs="text",outputs="text")
|
| 29 |
iface.launch()
|
|
|
|
| 22 |
def launch(input):
|
| 23 |
im=Image.open(requests.get(input,stream=True).raw)
|
| 24 |
image=transform(im.convert('RGB')).unsqueeze(0)
|
| 25 |
+
|
| 26 |
+
output=model.caption_image(image,dataset.vocab)
|
| 27 |
+
str=" ".join(output[1:-1])
|
| 28 |
|
| 29 |
+
return str
|
| 30 |
|
| 31 |
iface=gr.Interface(launch,inputs="text",outputs="text")
|
| 32 |
iface.launch()
|