Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ import torchvision.transforms as transforms
|
|
| 10 |
from PIL import Image
|
| 11 |
|
| 12 |
device = torch.device('cpu')
|
| 13 |
-
model = tag2text(pretrained='
|
| 14 |
model.threshold = 0.68
|
| 15 |
model.eval()
|
| 16 |
|
|
@@ -43,7 +43,7 @@ gr.Interface(
|
|
| 43 |
inputs=inputs,
|
| 44 |
outputs=outputs,
|
| 45 |
title="Tags and Captioning using Tag2Text",
|
| 46 |
-
description="Upload an image and see the
|
| 47 |
live=True,
|
| 48 |
|
| 49 |
).launch(share=True, enable_queue=True, debug=True)
|
|
|
|
| 10 |
from PIL import Image
|
| 11 |
|
| 12 |
device = torch.device('cpu')
|
| 13 |
+
model = tag2text(pretrained='tag2text.pth', image_size=384, vit='swin_b')
|
| 14 |
model.threshold = 0.68
|
| 15 |
model.eval()
|
| 16 |
|
|
|
|
| 43 |
inputs=inputs,
|
| 44 |
outputs=outputs,
|
| 45 |
title="Tags and Captioning using Tag2Text",
|
| 46 |
+
description="Upload an image and see the tags and captions in the output boxes",
|
| 47 |
live=True,
|
| 48 |
|
| 49 |
).launch(share=True, enable_queue=True, debug=True)
|