Spaces:
Sleeping
Sleeping
karan99300
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -19,8 +19,8 @@ model=CNNtoRNN(embed_size=256,hidden_size=256,vocab_size=len(dataset.vocab),num_
|
|
19 |
model.load_state_dict(torch.load(filepath,map_location='cpu'))
|
20 |
model.eval()
|
21 |
|
22 |
-
def launch(
|
23 |
-
im=Image.open(requests.get(
|
24 |
image=transform(im.convert('RGB')).unsqueeze(0)
|
25 |
|
26 |
output=model.caption_image(image,dataset.vocab)
|
|
|
19 |
model.load_state_dict(torch.load(filepath,map_location='cpu'))
|
20 |
model.eval()
|
21 |
|
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)
|