xmrt commited on
Commit
fa05982
·
1 Parent(s): c76c2fc

visualization

Browse files
Files changed (1) hide show
  1. main.py +6 -4
main.py CHANGED
@@ -6,18 +6,20 @@ print("[INFO]: Imported modules!")
6
 
7
  import gradio as gr
8
 
9
- def greet(photo):
10
  inferencer = MMPoseInferencer('human')
11
 
12
  print("[INFO]: Downloaded models!")
13
  print(photo)
14
- result_generator = inferencer(photo, show=False)
 
15
 
16
  print("[INFO]: Visualizing results!")
17
  # The MMPoseInferencer API employs a lazy inference approach,
18
  # creating a prediction generator when given input
19
  result = next(result_generator)
20
- print(result)
 
21
  return result['visualization']
22
 
23
  # # specify detection model by alias
@@ -32,7 +34,7 @@ def greet(photo):
32
 
33
  def run():
34
  #https://github.com/open-mmlab/mmpose/blob/main/docs/en/user_guides/inference.md
35
- demo = gr.Interface(fn=greet,
36
  inputs=gr.Image(source="webcam"),
37
  outputs=gr.Image())
38
 
 
6
 
7
  import gradio as gr
8
 
9
+ def poses(photo):
10
  inferencer = MMPoseInferencer('human')
11
 
12
  print("[INFO]: Downloaded models!")
13
  print(photo)
14
+ result_generator = inferencer(photo,
15
+ out_dir =".")
16
 
17
  print("[INFO]: Visualizing results!")
18
  # The MMPoseInferencer API employs a lazy inference approach,
19
  # creating a prediction generator when given input
20
  result = next(result_generator)
21
+ print(type(result))
22
+ print(result.shape)
23
  return result['visualization']
24
 
25
  # # specify detection model by alias
 
34
 
35
  def run():
36
  #https://github.com/open-mmlab/mmpose/blob/main/docs/en/user_guides/inference.md
37
+ demo = gr.Interface(fn=poses,
38
  inputs=gr.Image(source="webcam"),
39
  outputs=gr.Image())
40