Spaces:
Runtime error
Runtime error
Update dino/app.py
Browse files- dino/app.py +5 -2
dino/app.py
CHANGED
@@ -11,7 +11,10 @@ os.environ['KMP_DUPLICATE_LIB_OK']='True'
|
|
11 |
|
12 |
def func(resize, video):
|
13 |
output_dir = '/tmp/outputs'
|
14 |
-
|
|
|
|
|
|
|
15 |
if os.path.exists(output_dir):
|
16 |
shutil.rmtree(output_dir)
|
17 |
|
@@ -22,7 +25,7 @@ def func(resize, video):
|
|
22 |
patch_size=8,
|
23 |
pretrained_weights="dino_deitsmall8_pretrain.pth",
|
24 |
checkpoint_key="teacher",
|
25 |
-
input_path=
|
26 |
output_path=output_dir,
|
27 |
threshold=0.6,
|
28 |
resize=resize,
|
|
|
11 |
|
12 |
def func(resize, video):
|
13 |
output_dir = '/tmp/outputs'
|
14 |
+
input_video = '/tmp/input.mp4'
|
15 |
+
if os.path.exists(input_video):
|
16 |
+
os.remove(input_video)
|
17 |
+
subprocess.call(f"ffmpeg -ss 00:00:00 -i {video} -to 00:00:05 -c copy {input_video}".split())
|
18 |
if os.path.exists(output_dir):
|
19 |
shutil.rmtree(output_dir)
|
20 |
|
|
|
25 |
patch_size=8,
|
26 |
pretrained_weights="dino_deitsmall8_pretrain.pth",
|
27 |
checkpoint_key="teacher",
|
28 |
+
input_path=input_video,
|
29 |
output_path=output_dir,
|
30 |
threshold=0.6,
|
31 |
resize=resize,
|