Diego Fernandez commited on
Commit
0cb2d2a
1 Parent(s): 547bded

fix: cache examples

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. inference.py +4 -13
app.py CHANGED
@@ -44,7 +44,7 @@ iface = gr.Interface(
44
  inputs=intput_components,
45
  outputs=output_components,
46
  examples=example_list,
47
- cache_examples=False,
48
  )
49
 
50
  iface.launch()
 
44
  inputs=intput_components,
45
  outputs=output_components,
46
  examples=example_list,
47
+ cache_examples=True,
48
  )
49
 
50
  iface.launch()
inference.py CHANGED
@@ -19,22 +19,13 @@ from demo_utils.files import get_files
19
 
20
  def inference(
21
  input_video: str,
22
- cb_cache_output: bool,
23
- model: str,
24
- features: str,
25
- track_points: str,
26
- model_threshold: str,
27
  ):
28
  # temp_dir = tempfile.TemporaryDirectory()
29
  # output_path = temp_dir.name
30
-
31
- if cb_cache_output:
32
- for cache_video in get_files("examples"):
33
- if input_video.find(cache_video) == -1:
34
- continue
35
-
36
- cache_video_name = f"outputs/{cache_video}_{model}_out.mp4"
37
- return cache_video_name
38
 
39
  coord_transformations = None
40
  paths_drawer = None
 
19
 
20
  def inference(
21
  input_video: str,
22
+ model: str = "YOLOv7",
23
+ features: str = [0, 1],
24
+ track_points: str = "Bounding box",
25
+ model_threshold: float = 0.25,
 
26
  ):
27
  # temp_dir = tempfile.TemporaryDirectory()
28
  # output_path = temp_dir.name
 
 
 
 
 
 
 
 
29
 
30
  coord_transformations = None
31
  paths_drawer = None