Spaces:
Runtime error
Runtime error
Diego Fernandez
commited on
Commit
•
b17ce0d
1
Parent(s):
57a060c
chore: remove temp file
Browse files- app.py +3 -2
- inference.py +7 -6
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
@@ -30,7 +31,7 @@ intput_components = [
|
|
30 |
dd_model,
|
31 |
features,
|
32 |
dd_track_points,
|
33 |
-
slide_threshold
|
34 |
]
|
35 |
|
36 |
output_components = "playablevideo"
|
@@ -42,7 +43,7 @@ iface = gr.Interface(
|
|
42 |
inputs=intput_components,
|
43 |
outputs=output_components,
|
44 |
examples=example_list,
|
45 |
-
cache_examples=False
|
46 |
)
|
47 |
|
48 |
iface.launch()
|
|
|
1 |
import os
|
2 |
+
import tempfile
|
3 |
|
4 |
import gradio as gr
|
5 |
|
|
|
31 |
dd_model,
|
32 |
features,
|
33 |
dd_track_points,
|
34 |
+
slide_threshold
|
35 |
]
|
36 |
|
37 |
output_components = "playablevideo"
|
|
|
43 |
inputs=intput_components,
|
44 |
outputs=output_components,
|
45 |
examples=example_list,
|
46 |
+
cache_examples=False,
|
47 |
)
|
48 |
|
49 |
iface.launch()
|
inference.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
import argparse
|
2 |
-
import glob
|
3 |
import os
|
4 |
import tempfile
|
5 |
|
@@ -25,15 +23,15 @@ def inference(
|
|
25 |
track_points: str,
|
26 |
model_threshold: str,
|
27 |
):
|
28 |
-
temp_dir = tempfile.TemporaryDirectory()
|
29 |
-
output_path = temp_dir.name
|
30 |
|
31 |
coord_transformations = None
|
32 |
paths_drawer = None
|
33 |
fix_paths = False
|
34 |
track_points = style[track_points]
|
35 |
model = YOLO(models_path[model])
|
36 |
-
video = Video(input_path=input_video
|
37 |
|
38 |
motion_estimation = len(features) > 0 and (
|
39 |
features[0] == 0 or (len(features) > 1 and features[1] == 0)
|
@@ -100,4 +98,7 @@ def inference(
|
|
100 |
|
101 |
base_file_name = input_video.split("/")[-1].split(".")[0]
|
102 |
file_name = base_file_name + "_out.mp4"
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
import tempfile
|
3 |
|
|
|
23 |
track_points: str,
|
24 |
model_threshold: str,
|
25 |
):
|
26 |
+
# temp_dir = tempfile.TemporaryDirectory()
|
27 |
+
# output_path = temp_dir.name
|
28 |
|
29 |
coord_transformations = None
|
30 |
paths_drawer = None
|
31 |
fix_paths = False
|
32 |
track_points = style[track_points]
|
33 |
model = YOLO(models_path[model])
|
34 |
+
video = Video(input_path=input_video)
|
35 |
|
36 |
motion_estimation = len(features) > 0 and (
|
37 |
features[0] == 0 or (len(features) > 1 and features[1] == 0)
|
|
|
98 |
|
99 |
base_file_name = input_video.split("/")[-1].split(".")[0]
|
100 |
file_name = base_file_name + "_out.mp4"
|
101 |
+
|
102 |
+
# return os.path.join(output_path, file_name)
|
103 |
+
|
104 |
+
return file_name
|