IsshikiHugh commited on
Commit
8d3ae99
β€’
1 Parent(s): fc9d64f
Files changed (8) hide show
  1. .gitattributes +1 -0
  2. .gitignore +2 -1
  3. README.md +1 -1
  4. app/entry.py +0 -2
  5. app/env.py +15 -5
  6. app/handler.py +6 -4
  7. packages.txt +2 -0
  8. requirements.txt +0 -46
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.tar.gz filter=lfs diff=lfs merge=lfs -text
.gitignore CHANGED
@@ -1 +1,2 @@
1
- .DS_Store
 
 
1
+ .DS_Store
2
+ GVHMR
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: GV-HMR
3
  emoji: πŸ’ƒ
4
  colorFrom: pink
5
  colorTo: blue
 
1
  ---
2
+ title: GVHMR
3
  emoji: πŸ’ƒ
4
  colorFrom: pink
5
  colorTo: blue
app/entry.py CHANGED
@@ -6,8 +6,6 @@ from app.handler import handler
6
 
7
 
8
  if __name__ == '__main__':
9
- prepare_env()
10
-
11
  demo = gr.Interface(
12
  fn = handler,
13
  inputs = get_inputs_components(),
 
6
 
7
 
8
  if __name__ == '__main__':
 
 
9
  demo = gr.Interface(
10
  fn = handler,
11
  inputs = get_inputs_components(),
app/env.py CHANGED
@@ -14,10 +14,20 @@ def prepare_env():
14
  os.chdir(REPO_ROOT)
15
  run_cmds(
16
  f'''
17
- git clone https://github.com/zju3dv/GVHMR --recursive
18
- pip install -e .
19
- mkdir inputs
20
- mkdir outputs
21
- ln -s {REPO_ROOT}/GVHMR/tools ./app/
 
 
 
 
 
 
 
 
 
 
22
  '''
23
  )
 
14
  os.chdir(REPO_ROOT)
15
  run_cmds(
16
  f'''
17
+ git clone https://github.com/zju3dv/GVHMR --recursive {REPO_ROOT}/GVHMR
18
+ pip install -r {REPO_ROOT}/GVHMR/requirements.txt
19
+ pip install -e {REPO_ROOT}/GVHMR
20
+ mkdir {REPO_ROOT}/GVHMR/inputs
21
+ mkdir {REPO_ROOT}/GVHMR/outputs
22
+ ln -s {REPO_ROOT}/GVHMR/inputs {REPO_ROOT}/
23
+ ln -s {REPO_ROOT}/GVHMR/outputs {REPO_ROOT}/
24
+ ln -s {REPO_ROOT}/GVHMR/hmr4d {REPO_ROOT}/
25
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/SMPLer-X/resolve/main/SMPL_NEUTRAL.pkl -d {REPO_ROOT}/GVHMR/inputs/checkpoints/body_models/smpl -o SMPL_NEUTRAL.pkl
26
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/SMPLer-X/resolve/main/SMPLX_NEUTRAL.npz -d {REPO_ROOT}/GVHMR/inputs/checkpoints/body_models/smplx -o SMPLX_NEUTRAL.npz
27
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/GVHMR/resolve/main/dpvo/dpvo.pth -d {REPO_ROOT}/GVHMR/inputs/checkpoints/dpvo -o dpvo.pth
28
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/GVHMR/resolve/main/gvhmr/gvhmr_siga24_release.ckpt -d {REPO_ROOT}/GVHMR/inputs/checkpoints/gvhmr -o gvhmr_siga24_release.ckpt
29
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/GVHMR/resolve/main/hmr2/epoch%3D10-step%3D25000.ckpt -d {REPO_ROOT}/GVHMR/inputs/checkpoints/hmr2 -o epoch=10-step=25000.ckpt
30
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/GVHMR/resolve/main/vitpose/vitpose-h-multi-coco.pth -d {REPO_ROOT}/GVHMR/inputs/checkpoints/vitpose -o vitpose-h-multi-coco.pth
31
+ aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/GVHMR/resolve/main/yolo/yolov8x.pt -d {REPO_ROOT}/GVHMR/inputs/checkpoints/yolo -o yolov8x.pt
32
  '''
33
  )
app/handler.py CHANGED
@@ -1,6 +1,8 @@
1
  import spaces
2
  import gradio as gr
3
 
 
 
4
  from .demo import *
5
 
6
 
@@ -39,7 +41,7 @@ def prepare_cfg(is_static:bool, video_path:str, demo_id:str):
39
  return cfg
40
 
41
 
42
- @spaces.GPU(duration=120)
43
  def run_demo(cfg, progress):
44
  paths = cfg.paths
45
  Log.info(f"[GPU]: {torch.cuda.get_device_name()}")
@@ -71,7 +73,7 @@ def run_demo(cfg, progress):
71
 
72
  return
73
 
74
- def handler(cam_status, video_path, progress=gr.Progress()):
75
  # 0. Check validity of inputs.
76
  if cam_status not in ['Static Camera', 'Dynamic Camera']:
77
  raise gr.Error('Please define the camera status!', duration=5)
@@ -89,9 +91,9 @@ def handler(cam_status, video_path, progress=gr.Progress()):
89
  cfg = prepare_cfg(is_static, video_path, demo_id)
90
 
91
  # 3. Run demo.
 
 
92
  run_demo(cfg, progress)
93
- from ipdb import set_trace
94
- set_trace()
95
 
96
  # 4. Prepare the output.
97
  return cfg.paths.incam_video, cfg.paths.global_video
 
1
  import spaces
2
  import gradio as gr
3
 
4
+ from omegaconf import OmegaConf
5
+
6
  from .demo import *
7
 
8
 
 
41
  return cfg
42
 
43
 
44
+ @spaces.GPU
45
  def run_demo(cfg, progress):
46
  paths = cfg.paths
47
  Log.info(f"[GPU]: {torch.cuda.get_device_name()}")
 
73
 
74
  return
75
 
76
+ def handler(video_path, cam_status, progress=gr.Progress()):
77
  # 0. Check validity of inputs.
78
  if cam_status not in ['Static Camera', 'Dynamic Camera']:
79
  raise gr.Error('Please define the camera status!', duration=5)
 
91
  cfg = prepare_cfg(is_static, video_path, demo_id)
92
 
93
  # 3. Run demo.
94
+ cfg = OmegaConf.to_container(cfg, resolve=True)
95
+ cfg = OmegaConf.create(cfg)
96
  run_demo(cfg, progress)
 
 
97
 
98
  # 4. Prepare the output.
99
  return cfg.paths.incam_video, cfg.paths.global_video
packages.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ tmux
2
+ aria2
requirements.txt CHANGED
@@ -1,46 +0,0 @@
1
- # PyTorch
2
- --extra-index-url https://download.pytorch.org/whl/cu121
3
- torch==2.3.0+cu121
4
- torchvision==0.18.0+cu121
5
- timm==0.9.12 # For HMR2.0a feature extraction
6
-
7
- # Lightning + Hydra
8
- lightning==2.3.0
9
- hydra-core==1.3
10
- hydra-zen
11
- hydra_colorlog
12
- rich
13
-
14
- # Common utilities
15
- numpy==1.23.5
16
- jupyter
17
- matplotlib
18
- ipdb
19
- setuptools>=68.0
20
- black
21
- tensorboardX
22
- opencv-python
23
- ffmpeg-python
24
- scikit-image
25
- termcolor
26
- einops
27
- imageio==2.34.1
28
- av # imageio[pyav], improved performance over imageio[ffmpeg]
29
- joblib
30
-
31
- # Diffusion
32
- # diffusers[torch]==0.19.3
33
- # transformers==4.31.0
34
-
35
- # 3D-Vision
36
- pytorch3d @ https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cu121_pyt230/pytorch3d-0.7.6-cp310-cp310-linux_x86_64.whl
37
- trimesh
38
- chumpy
39
- smplx
40
- # open3d==0.17.0
41
- wis3d
42
-
43
- # 2D-Pose
44
- ultralytics==8.2.42 # YOLO
45
- cython_bbox
46
- lapx