Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,13 +10,12 @@ import matplotlib.pyplot as plt
|
|
10 |
import tempfile
|
11 |
import shutil
|
12 |
|
13 |
-
|
14 |
-
device = "cpu"
|
15 |
|
16 |
processor = Owlv2Processor.from_pretrained("google/owlv2-base-patch16")
|
17 |
model = Owlv2ForObjectDetection.from_pretrained("google/owlv2-base-patch16")
|
18 |
|
19 |
-
model = model.to(device)
|
20 |
|
21 |
def process_video(video_path, target, progress=gr.Progress()):
|
22 |
if video_path is None:
|
|
|
10 |
import tempfile
|
11 |
import shutil
|
12 |
|
13 |
+
device = "cuda"
|
|
|
14 |
|
15 |
processor = Owlv2Processor.from_pretrained("google/owlv2-base-patch16")
|
16 |
model = Owlv2ForObjectDetection.from_pretrained("google/owlv2-base-patch16")
|
17 |
|
18 |
+
model = model.to(device)
|
19 |
|
20 |
def process_video(video_path, target, progress=gr.Progress()):
|
21 |
if video_path is None:
|