Spaces:
Build error
Build error
Commit
·
f995acb
1
Parent(s):
c30cdc1
fix to device
Browse files
app.py
CHANGED
@@ -12,7 +12,8 @@ import warnings
|
|
12 |
warnings.filterwarnings("ignore")
|
13 |
|
14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
15 |
-
model, preprocess = clip.load('ViT-L/14@336px')
|
|
|
16 |
|
17 |
|
18 |
def zeroshot_detection(Press_Clear_Dont_Stack_Image):
|
@@ -35,3 +36,4 @@ def zeroshot_detection(Press_Clear_Dont_Stack_Image):
|
|
35 |
gr.Interface(fn=zeroshot_detection,
|
36 |
inputs=[gr.Image(type="pil")],
|
37 |
outputs=gr.Label(num_top_classes=1)).launch()
|
|
|
|
12 |
warnings.filterwarnings("ignore")
|
13 |
|
14 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
15 |
+
model, preprocess = clip.load('ViT-L/14@336px')
|
16 |
+
model.to(device)
|
17 |
|
18 |
|
19 |
def zeroshot_detection(Press_Clear_Dont_Stack_Image):
|
|
|
36 |
gr.Interface(fn=zeroshot_detection,
|
37 |
inputs=[gr.Image(type="pil")],
|
38 |
outputs=gr.Label(num_top_classes=1)).launch()
|
39 |
+
|