randomshit11 commited on
Commit
86a48df
·
verified ·
1 Parent(s): 30b0808

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +9 -6
main.py CHANGED
@@ -28,7 +28,7 @@ def process(video_path, pose_type):
28
  print("Video processing has been successfully completed.")
29
  break
30
  frame_count += 1
31
- results = model.track(im0, verbose=False) # Tracking recommended
32
  im0 = gym_object.start_counting(im0, results, frame_count)
33
  video_writer.write(im0)
34
 
@@ -40,19 +40,22 @@ def process(video_path, pose_type):
40
 
41
  title = "Push-up Counter"
42
  description = "This app counts the number of push-ups in a video."
43
- inputs = [gr.Video(label='Input Video'),
44
- gr.Radio(["pullup", "pushup", "abworkout"], label="Pose Type")]
 
 
 
45
  outputs = gr.Video(label='Output Video')
46
 
47
- # example_list = [['Examples/PULL-UPS.mp4'],['Examples/PUSH-UPS.mp4']]
48
  # Create the Gradio demo
49
  demo = gr.Interface(fn=process,
50
  inputs=inputs,
51
  outputs=outputs,
52
  title=title,
53
  description=description
54
- # examples=example_list
55
- # cache_examples=True
56
  )
57
 
58
  # Launch the demo!
 
28
  print("Video processing has been successfully completed.")
29
  break
30
  frame_count += 1
31
+ results = model.track(im0, verbose=True) # Tracking recommended
32
  im0 = gym_object.start_counting(im0, results, frame_count)
33
  video_writer.write(im0)
34
 
 
40
 
41
  title = "Push-up Counter"
42
  description = "This app counts the number of push-ups in a video."
43
+ inputs = [
44
+ gr.Video(label='Input Video'),
45
+ gr.Radio(["pullup", "pushup", "abworkout"], label="Pose Type", default="pullup")
46
+ ]
47
+
48
  outputs = gr.Video(label='Output Video')
49
 
50
+ example_list = [['Examples/PULL-UPS.mp4'],['Examples/PUSH-UPS.mp4']]
51
  # Create the Gradio demo
52
  demo = gr.Interface(fn=process,
53
  inputs=inputs,
54
  outputs=outputs,
55
  title=title,
56
  description=description
57
+ examples=example_list
58
+ cache_examples=True
59
  )
60
 
61
  # Launch the demo!