visualization
Browse files
main.py
CHANGED
@@ -2,19 +2,22 @@ import mmpose
|
|
2 |
import os
|
3 |
from mmpose.apis import MMPoseInferencer
|
4 |
|
5 |
-
inferencer = MMPoseInferencer('human')
|
6 |
print("[INFO]: Imported modules!")
|
7 |
|
8 |
import gradio as gr
|
9 |
|
10 |
def greet(photo):
|
|
|
|
|
11 |
print("[INFO]: Downloaded models!")
|
12 |
-
|
|
|
13 |
|
14 |
print("[INFO]: Visualizing results!")
|
|
|
|
|
15 |
result = next(result_generator)
|
16 |
-
print(
|
17 |
-
print(result['visualization'])
|
18 |
return result['visualization']
|
19 |
|
20 |
# # specify detection model by alias
|
@@ -28,6 +31,7 @@ def greet(photo):
|
|
28 |
# )
|
29 |
|
30 |
def run():
|
|
|
31 |
demo = gr.Interface(fn=greet,
|
32 |
inputs=gr.Image(source="webcam"),
|
33 |
outputs=gr.Image())
|
|
|
2 |
import os
|
3 |
from mmpose.apis import MMPoseInferencer
|
4 |
|
|
|
5 |
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
|
|
|
31 |
# )
|
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())
|