MMpose / main.py
xmrt's picture
new test dicler
afd2199
raw
history blame
903 Bytes
import mmpose
print(mmpose.__version__)
from mmpose.apis import MMPoseInferencer
inferencer = MMPoseInferencer('human')
print("[INFO]: Imported modules!!")
import gradio as gr
def greet(photo):
print("[INFO]: Downloaded models!")
result_generator = inferencer(photo)
print("[INFO]: Visualizing results!")
vis, pred = next(result_generator)
return vis
# # specify detection model by alias
# # the available aliases include 'human', 'hand', 'face', 'animal',
# # as well as any additional aliases defined in mmdet
# inferencer = MMPoseInferencer(
# # suppose the pose estimator is trained on custom dataset
# pose2d='custom_human_pose_estimator.py',
# pose2d_weights='custom_human_pose_estimator.pth',
# det_model='human'
# )
if __name__ == '__main__':
demo = gr.Interface(fn=greet, inputs=gr.Image(source="webcam"), outputs=gr.Image())
demo.launch()