file display
Browse files
main.py
CHANGED
@@ -1,17 +1,26 @@
|
|
|
|
1 |
import mmpose
|
2 |
-
import os
|
3 |
-
import glob
|
4 |
from mmpose.apis import MMPoseInferencer
|
|
|
|
|
5 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
import numpy as np
|
7 |
import cv2
|
8 |
-
import uuid
|
9 |
|
10 |
print("[INFO]: Imported modules!")
|
11 |
human = MMPoseInferencer("human")
|
12 |
hand = MMPoseInferencer("hand")
|
13 |
human3d = MMPoseInferencer(pose3d="human3d")
|
|
|
14 |
|
|
|
15 |
inferencers = {"Estimate human 2d poses":human, "Estimate human 2d hand poses":hand, "Estimate human 3d poses":human3d}
|
16 |
|
17 |
# inferencer = MMPoseInferencer('human')
|
@@ -75,7 +84,7 @@ def run():
|
|
75 |
webcam = gr.Interface(
|
76 |
fn=poses,
|
77 |
inputs= [gr.Video(source="webcam", height=412), check_web],
|
78 |
-
outputs = [gr.PlayableVideo()]*len(
|
79 |
title = 'Pose estimation',
|
80 |
description = 'Pose estimation on video',
|
81 |
allow_flagging=False
|
@@ -84,7 +93,7 @@ def run():
|
|
84 |
file = gr.Interface(
|
85 |
poses,
|
86 |
inputs = [gr.Video(source="upload", height=412), check_file],
|
87 |
-
outputs = [gr.PlayableVideo()]*len(
|
88 |
allow_flagging=False
|
89 |
)
|
90 |
|
|
|
1 |
+
# Pose inferencing
|
2 |
import mmpose
|
|
|
|
|
3 |
from mmpose.apis import MMPoseInferencer
|
4 |
+
|
5 |
+
# Gradio
|
6 |
import gradio as gr
|
7 |
+
|
8 |
+
# System and files
|
9 |
+
import os
|
10 |
+
import glob
|
11 |
+
import uuid
|
12 |
+
|
13 |
+
# Image manipulation
|
14 |
import numpy as np
|
15 |
import cv2
|
|
|
16 |
|
17 |
print("[INFO]: Imported modules!")
|
18 |
human = MMPoseInferencer("human")
|
19 |
hand = MMPoseInferencer("hand")
|
20 |
human3d = MMPoseInferencer(pose3d="human3d")
|
21 |
+
# ultraltics
|
22 |
|
23 |
+
# Defining inferencer models to lookup in function
|
24 |
inferencers = {"Estimate human 2d poses":human, "Estimate human 2d hand poses":hand, "Estimate human 3d poses":human3d}
|
25 |
|
26 |
# inferencer = MMPoseInferencer('human')
|
|
|
84 |
webcam = gr.Interface(
|
85 |
fn=poses,
|
86 |
inputs= [gr.Video(source="webcam", height=412), check_web],
|
87 |
+
outputs = [gr.PlayableVideo()]*len(available_methods), #file_types=['.mp4'] #gr.Video(),
|
88 |
title = 'Pose estimation',
|
89 |
description = 'Pose estimation on video',
|
90 |
allow_flagging=False
|
|
|
93 |
file = gr.Interface(
|
94 |
poses,
|
95 |
inputs = [gr.Video(source="upload", height=412), check_file],
|
96 |
+
outputs = [gr.PlayableVideo()]*len(available_methods),
|
97 |
allow_flagging=False
|
98 |
)
|
99 |
|