visualization
Browse files
main.py
CHANGED
@@ -1,25 +1,27 @@
|
|
1 |
import mmpose
|
2 |
import os
|
3 |
from mmpose.apis import MMPoseInferencer
|
4 |
-
|
5 |
print("[INFO]: Imported modules!")
|
6 |
|
7 |
import gradio as gr
|
8 |
import numpy as np
|
9 |
|
10 |
-
|
11 |
-
|
|
|
12 |
|
13 |
-
|
14 |
print(photo)
|
15 |
result_generator = inferencer(photo,
|
16 |
-
|
17 |
return_vis=True)
|
18 |
-
|
19 |
print("[INFO]: Visualizing results!")
|
|
|
20 |
# The MMPoseInferencer API employs a lazy inference approach,
|
21 |
# creating a prediction generator when given input
|
22 |
result = next(result_generator)
|
|
|
|
|
23 |
return result["visualization"]
|
24 |
|
25 |
# # specify detection model by alias
|
|
|
1 |
import mmpose
|
2 |
import os
|
3 |
from mmpose.apis import MMPoseInferencer
|
|
|
4 |
print("[INFO]: Imported modules!")
|
5 |
|
6 |
import gradio as gr
|
7 |
import numpy as np
|
8 |
|
9 |
+
inferencer = MMPoseInferencer('human')
|
10 |
+
print("[INFO]: Downloaded models!")
|
11 |
+
|
12 |
|
13 |
+
def poses(photo):
|
14 |
print(photo)
|
15 |
result_generator = inferencer(photo,
|
16 |
+
vis_out_dir =".",
|
17 |
return_vis=True)
|
|
|
18 |
print("[INFO]: Visualizing results!")
|
19 |
+
|
20 |
# The MMPoseInferencer API employs a lazy inference approach,
|
21 |
# creating a prediction generator when given input
|
22 |
result = next(result_generator)
|
23 |
+
print(os.listdir())
|
24 |
+
print(type(result["visualization"]))
|
25 |
return result["visualization"]
|
26 |
|
27 |
# # specify detection model by alias
|