Spaces:
Sleeping
Sleeping
working gradio demo
Browse files- app.py +7 -5
- requirements.txt +3 -2
app.py
CHANGED
@@ -4,10 +4,12 @@ import glob
|
|
4 |
import numpy as np
|
5 |
import cv2
|
6 |
import PIL.Image as pil_img
|
7 |
-
import
|
8 |
|
9 |
-
|
10 |
-
|
|
|
|
|
11 |
|
12 |
import gradio as gr
|
13 |
|
@@ -170,9 +172,9 @@ def main(pil_img, out_dir='demo_out', model_path='checkpoint/deco_best.pth', mes
|
|
170 |
|
171 |
rend = create_scene(body_model_smpl, img)
|
172 |
os.makedirs(os.path.join(out_dir, 'Renders'), exist_ok=True)
|
173 |
-
rend.save(os.path.join(out_dir, 'Renders',
|
174 |
|
175 |
-
mesh_out_dir = os.path.join(out_dir, 'Preds'
|
176 |
os.makedirs(mesh_out_dir, exist_ok=True)
|
177 |
|
178 |
print(f'Saving mesh to {mesh_out_dir}')
|
|
|
4 |
import numpy as np
|
5 |
import cv2
|
6 |
import PIL.Image as pil_img
|
7 |
+
import subprocess
|
8 |
|
9 |
+
subprocess.run(
|
10 |
+
'pip install networkx==2.5'
|
11 |
+
.split()
|
12 |
+
)
|
13 |
|
14 |
import gradio as gr
|
15 |
|
|
|
172 |
|
173 |
rend = create_scene(body_model_smpl, img)
|
174 |
os.makedirs(os.path.join(out_dir, 'Renders'), exist_ok=True)
|
175 |
+
rend.save(os.path.join(out_dir, 'Renders', 'pred.png'))
|
176 |
|
177 |
+
mesh_out_dir = os.path.join(out_dir, 'Preds')
|
178 |
os.makedirs(mesh_out_dir, exist_ok=True)
|
179 |
|
180 |
print(f'Saving mesh to {mesh_out_dir}')
|
requirements.txt
CHANGED
@@ -5,8 +5,7 @@ torchvision==0.14.0+cu117
|
|
5 |
opencv-python
|
6 |
loguru
|
7 |
monai
|
8 |
-
|
9 |
-
pyrender
|
10 |
smplx==0.1.28
|
11 |
scikit-learn
|
12 |
scikit-image
|
@@ -18,3 +17,5 @@ flatten_dict
|
|
18 |
chumpy
|
19 |
numpy==1.23.1
|
20 |
yacs
|
|
|
|
|
|
5 |
opencv-python
|
6 |
loguru
|
7 |
monai
|
8 |
+
pyrender==0.1.33
|
|
|
9 |
smplx==0.1.28
|
10 |
scikit-learn
|
11 |
scikit-image
|
|
|
17 |
chumpy
|
18 |
numpy==1.23.1
|
19 |
yacs
|
20 |
+
gradio
|
21 |
+
ipykernel
|