visualization
Browse files- Dockerfile +1 -0
- main.py +3 -6
Dockerfile
CHANGED
@@ -24,6 +24,7 @@ WORKDIR /..
|
|
24 |
# RUN mim install "mmpose>=1.1.0"
|
25 |
|
26 |
RUN pip install --no-cache-dir --upgrade gradio
|
|
|
27 |
|
28 |
#https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
|
29 |
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
|
|
|
24 |
# RUN mim install "mmpose>=1.1.0"
|
25 |
|
26 |
RUN pip install --no-cache-dir --upgrade gradio
|
27 |
+
RUN pip install --no-cache-dir --upgrade numpy
|
28 |
|
29 |
#https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
|
30 |
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
|
main.py
CHANGED
@@ -5,6 +5,7 @@ from mmpose.apis import MMPoseInferencer
|
|
5 |
print("[INFO]: Imported modules!")
|
6 |
|
7 |
import gradio as gr
|
|
|
8 |
|
9 |
def poses(photo):
|
10 |
inferencer = MMPoseInferencer('human')
|
@@ -18,12 +19,8 @@ def poses(photo):
|
|
18 |
# The MMPoseInferencer API employs a lazy inference approach,
|
19 |
# creating a prediction generator when given input
|
20 |
result = next(result_generator)
|
21 |
-
|
22 |
-
|
23 |
-
print(type(result['visualization']))
|
24 |
-
print(result['visualization'][0])
|
25 |
-
print(type(result['visualization'][0]))
|
26 |
-
return result['visualization'][0]
|
27 |
|
28 |
# # specify detection model by alias
|
29 |
# # the available aliases include 'human', 'hand', 'face', 'animal',
|
|
|
5 |
print("[INFO]: Imported modules!")
|
6 |
|
7 |
import gradio as gr
|
8 |
+
import numpy as np
|
9 |
|
10 |
def poses(photo):
|
11 |
inferencer = MMPoseInferencer('human')
|
|
|
19 |
# The MMPoseInferencer API employs a lazy inference approach,
|
20 |
# creating a prediction generator when given input
|
21 |
result = next(result_generator)
|
22 |
+
output = np.array(result["visualization"])
|
23 |
+
return output
|
|
|
|
|
|
|
|
|
24 |
|
25 |
# # specify detection model by alias
|
26 |
# # the available aliases include 'human', 'hand', 'face', 'animal',
|