Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
-
from IPython.display import clear_output, Image
|
| 2 |
-
import argparse
|
| 3 |
import numpy as np
|
| 4 |
import random
|
| 5 |
from PIL import Image
|
|
@@ -11,7 +9,7 @@ import torch
|
|
| 11 |
import torchvision.transforms as transforms
|
| 12 |
from PIL import Image
|
| 13 |
|
| 14 |
-
|
| 15 |
model = tag2text(pretrained='/content/recognize-anything/tag2text.pth', image_size=384, vit='swin_b')
|
| 16 |
model.threshold = 0.68
|
| 17 |
model.eval()
|
|
|
|
|
|
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
import random
|
| 3 |
from PIL import Image
|
|
|
|
| 9 |
import torchvision.transforms as transforms
|
| 10 |
from PIL import Image
|
| 11 |
|
| 12 |
+
device = torch.device('cpu')
|
| 13 |
model = tag2text(pretrained='/content/recognize-anything/tag2text.pth', image_size=384, vit='swin_b')
|
| 14 |
model.threshold = 0.68
|
| 15 |
model.eval()
|