docker and app
Browse files- Dockerfile +0 -0
- app.py +31 -0
Dockerfile
ADDED
File without changes
|
app.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import mmpose
|
2 |
+
print(mmpose.__version__)
|
3 |
+
from mmpose.apis import MMPoseInferencer
|
4 |
+
inferencer = MMPoseInferencer(
|
5 |
+
pose3d='human')
|
6 |
+
|
7 |
+
# conda create -n mmpose python=3.8 -y
|
8 |
+
# conda activate mmpose
|
9 |
+
# pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
|
10 |
+
# pip install mmengine
|
11 |
+
|
12 |
+
# git clone https://github.com/open-mmlab/playground.git
|
13 |
+
# cd playground
|
14 |
+
|
15 |
+
# pip install -U openmim
|
16 |
+
# mim install "mmcv>=2.0.0"
|
17 |
+
|
18 |
+
# git clone https://github.com/open-mmlab/mmpose.git
|
19 |
+
# cd mmpose; pip install -e .; cd ..
|
20 |
+
|
21 |
+
import gradio as gr
|
22 |
+
|
23 |
+
def greet(photo):
|
24 |
+
|
25 |
+
result_generator = inferencer(photo)
|
26 |
+
vis, pred = next(result_generator)
|
27 |
+
return vis
|
28 |
+
|
29 |
+
demo = gr.Interface(fn=greet, inputs=gr.Image(source="webcam"), outputs=gr.Image())
|
30 |
+
|
31 |
+
demo.launch()
|