xmrt commited on
Commit
5a730a3
1 Parent(s): b6358bf

skipping tracking

Browse files
Files changed (1) hide show
  1. main.py +5 -5
main.py CHANGED
@@ -49,7 +49,7 @@ def show_tracking(video_content, vis_out_dir, model):
49
  video_track = tracking(video_content, model.track)
50
 
51
  # Prepare to save video
52
- out_file = os.path.join(vis_out_dir, "track.mp4")
53
  out_file = "track.mp4"
54
  print("[INFO]: TRACK", out_file)
55
 
@@ -100,7 +100,7 @@ def infer(video, check):
100
  inferencer = inferencers[i] # 'hand', 'human , device='cuda'
101
 
102
  if i == "Detect and track":
103
- continue
104
  out_file = show_tracking(video, vis_out_dir, inferencer)
105
 
106
  else:
@@ -110,7 +110,7 @@ def infer(video, check):
110
  out_files.extend(out_file)
111
  print(out_files)
112
 
113
- return out_files[0], out_files[1], out_files[2]#, out_files[3]
114
 
115
  def run():
116
  #https://github.com/open-mmlab/mmpose/blob/main/docs/en/user_guides/inference.md
@@ -120,7 +120,7 @@ def run():
120
  webcam = gr.Interface(
121
  fn=infer,
122
  inputs= [gr.Video(source="webcam", height=412), check_web],
123
- outputs = [gr.PlayableVideo(), gr.PlayableVideo(), gr.PlayableVideo()],# gr.PlayableVideo()],
124
  title = 'Pose estimation',
125
  description = 'Pose estimation on video',
126
  allow_flagging=False
@@ -129,7 +129,7 @@ def run():
129
  file = gr.Interface(
130
  infer,
131
  inputs = [gr.Video(source="upload", height=412), check_file],
132
- outputs = [gr.PlayableVideo(), gr.PlayableVideo(), gr.PlayableVideo()],#, gr.PlayableVideo()],
133
  allow_flagging=False
134
  )
135
 
 
49
  video_track = tracking(video_content, model.track)
50
 
51
  # Prepare to save video
52
+ #out_file = os.path.join(vis_out_dir, "track.mp4")
53
  out_file = "track.mp4"
54
  print("[INFO]: TRACK", out_file)
55
 
 
100
  inferencer = inferencers[i] # 'hand', 'human , device='cuda'
101
 
102
  if i == "Detect and track":
103
+ #continue
104
  out_file = show_tracking(video, vis_out_dir, inferencer)
105
 
106
  else:
 
110
  out_files.extend(out_file)
111
  print(out_files)
112
 
113
+ return out_files[0], out_files[1], out_files[2], out_file # out_files[3]
114
 
115
  def run():
116
  #https://github.com/open-mmlab/mmpose/blob/main/docs/en/user_guides/inference.md
 
120
  webcam = gr.Interface(
121
  fn=infer,
122
  inputs= [gr.Video(source="webcam", height=412), check_web],
123
+ outputs = [gr.PlayableVideo(), gr.PlayableVideo(), gr.PlayableVideo() gr.PlayableVideo()],
124
  title = 'Pose estimation',
125
  description = 'Pose estimation on video',
126
  allow_flagging=False
 
129
  file = gr.Interface(
130
  infer,
131
  inputs = [gr.Video(source="upload", height=412), check_file],
132
+ outputs = [gr.PlayableVideo(), gr.PlayableVideo(), gr.PlayableVideo(), gr.PlayableVideo()],
133
  allow_flagging=False
134
  )
135