Yuliang commited on
Commit
a89c249
1 Parent(s): f836225

fix bugs of installation

Browse files
Files changed (3) hide show
  1. app.py +6 -4
  2. apps/infer.py +3 -1
  3. requirements.txt +2 -1
app.py CHANGED
@@ -10,11 +10,11 @@ import subprocess
10
 
11
  if os.getenv('SYSTEM') == 'spaces':
12
  subprocess.run('pip install pyembree'.split())
13
- subprocess.run('pip install rembg'.split())
14
  subprocess.run(
15
  'pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html'.split())
16
  subprocess.run(
17
- 'pip install git+https://github.com/YuliangXiu/kaolin.git'.split())
18
  subprocess.run('pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1110/download.html'.split())
19
  subprocess.run(
20
  'pip install git+https://github.com/Project-Splinter/human_det.git'.split())
@@ -117,7 +117,7 @@ with gr.Blocks() as demo:
117
 
118
  gr.Examples(examples=examples,
119
  inputs=[inp, radio_choice],
120
- cache_examples=True,
121
  fn=generate_model,
122
  outputs=out_lst)
123
 
@@ -139,9 +139,11 @@ with gr.Blocks() as demo:
139
  clear_color=[0.0, 0.0, 0.0, 0.0], label="Refined Recon")
140
  out_final_download = gr.File(
141
  label="Download refined clothed human mesh")
 
 
142
 
143
  out_lst = [out_smpl, out_smpl_download, out_smpl_npy_download, out_recon, out_recon_download,
144
- out_final, out_final_download, out_vid, out_vid_download, overlap_inp]
145
 
146
  btn_submit.click(fn=generate_model, inputs=[
147
  inp, radio_choice], outputs=out_lst)
 
10
 
11
  if os.getenv('SYSTEM') == 'spaces':
12
  subprocess.run('pip install pyembree'.split())
13
+ subprocess.run('pip install git+https://github.com/YuliangXiu/rembg.git@hf'.split())
14
  subprocess.run(
15
  'pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html'.split())
16
  subprocess.run(
17
+ 'pip wheel git+https://github.com/YuliangXiu/kaolin.git -w /home/user/app && pip install /home/user/app/kaolin-0.11.0-cp38-cp38-linux_x86_64.whl', shell=True)
18
  subprocess.run('pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1110/download.html'.split())
19
  subprocess.run(
20
  'pip install git+https://github.com/Project-Splinter/human_det.git'.split())
 
117
 
118
  gr.Examples(examples=examples,
119
  inputs=[inp, radio_choice],
120
+ cache_examples=False,
121
  fn=generate_model,
122
  outputs=out_lst)
123
 
 
139
  clear_color=[0.0, 0.0, 0.0, 0.0], label="Refined Recon")
140
  out_final_download = gr.File(
141
  label="Download refined clothed human mesh")
142
+ out_kaolin_download = gr.File(
143
+ label="Kaolin")
144
 
145
  out_lst = [out_smpl, out_smpl_download, out_smpl_npy_download, out_recon, out_recon_download,
146
+ out_final, out_final_download, out_vid, out_vid_download, overlap_inp, out_kaolin_download]
147
 
148
  btn_submit.click(fn=generate_model, inputs=[
149
  inp, radio_choice], outputs=out_lst)
apps/infer.py CHANGED
@@ -463,8 +463,10 @@ def generate_model(in_path, model_type):
463
  gc.collect()
464
  torch.cuda.empty_cache()
465
 
 
 
466
  return [smpl_glb_path, smpl_obj_path,
467
  smpl_npy_path,
468
  recon_glb_path, recon_obj_path,
469
  refine_glb_path, refine_obj_path,
470
- video_path, video_path, overlap_path]
 
463
  gc.collect()
464
  torch.cuda.empty_cache()
465
 
466
+ kaolin_path = "/home/user/app/kaolin-0.11.0-cp38-cp38-linux_x86_64.whl"
467
+
468
  return [smpl_glb_path, smpl_obj_path,
469
  smpl_npy_path,
470
  recon_glb_path, recon_obj_path,
471
  refine_glb_path, refine_obj_path,
472
+ video_path, video_path, overlap_path, kaolin_path]
requirements.txt CHANGED
@@ -1,3 +1,5 @@
 
 
1
  matplotlib==3.5.0
2
  Pillow==9.0.0
3
  PyOpenGL
@@ -15,7 +17,6 @@ rtree==0.9.7
15
  pytorch_lightning==1.2.5
16
  PyMCubes
17
  chumpy
18
- rembg>=2.0.3
19
  opencv-python
20
  opencv_contrib_python
21
  scikit-learn
 
1
+ pip>=21.2.4
2
+ numpy==1.22.4
3
  matplotlib==3.5.0
4
  Pillow==9.0.0
5
  PyOpenGL
 
17
  pytorch_lightning==1.2.5
18
  PyMCubes
19
  chumpy
 
20
  opencv-python
21
  opencv_contrib_python
22
  scikit-learn