IsshikiHugh commited on
Commit
da2f55c
·
1 Parent(s): 6b3779f

update: add desc

Browse files
.gitignore CHANGED
@@ -1,2 +1,3 @@
1
  .DS_Store
2
- GVHMR
 
 
1
  .DS_Store
2
+ GVHMR
3
+ build
app.py CHANGED
@@ -1,5 +1,36 @@
1
  import os
2
- from app.env import prepare_env
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  if __name__ == '__main__':
5
  prepare_env()
 
1
  import os
2
+
3
+ REPO_ROOT = str(os.path.join(os.path.dirname(__file__)))
4
+
5
+ def run_cmds(cmds):
6
+ cmds = cmds.split('\n')
7
+ for cmd in cmds:
8
+ if len(cmd) == 0:
9
+ continue
10
+ os.system(cmd)
11
+
12
+
13
+ def prepare_env():
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
+ )
34
 
35
  if __name__ == '__main__':
36
  prepare_env()
app/__pycache__/__init__.cpython-38.pyc ADDED
Binary file (162 Bytes). View file
 
app/__pycache__/demo.cpython-38.pyc ADDED
Binary file (9.17 kB). View file
 
app/__pycache__/entry.cpython-38.pyc ADDED
Binary file (640 Bytes). View file
 
app/{env.py → __pycache__/env.cpython-38.pyc} RENAMED
Binary files a/app/env.py and b/app/__pycache__/env.cpython-38.pyc differ
 
app/__pycache__/gui.cpython-38.pyc ADDED
Binary file (2.63 kB). View file
 
app/__pycache__/handler.cpython-38.pyc ADDED
Binary file (3.4 kB). View file
 
app/entry.py CHANGED
@@ -1,16 +1,19 @@
1
  import gradio as gr
2
 
3
- from app.env import prepare_env
4
- from app.gui import get_inputs_components, get_outputs_components, get_examples
5
  from app.handler import handler
6
 
7
 
8
- if __name__ == '__main__':
9
  demo = gr.Interface(
10
- fn = handler,
11
- inputs = get_inputs_components(),
12
- outputs = get_outputs_components(),
13
- examples = get_examples(),
 
14
  )
15
 
16
- demo.launch()
 
 
 
 
1
  import gradio as gr
2
 
3
+ from app.gui import get_inputs_components, get_outputs_components, get_examples, get_desc
 
4
  from app.handler import handler
5
 
6
 
7
+ def entry():
8
  demo = gr.Interface(
9
+ fn = handler,
10
+ inputs = get_inputs_components(),
11
+ outputs = get_outputs_components(),
12
+ examples = get_examples(),
13
+ description = get_desc(),
14
  )
15
 
16
+ demo.launch()
17
+
18
+ if __name__ == '__main__':
19
+ entry()
app/gui.py CHANGED
@@ -39,6 +39,34 @@ def get_examples():
39
  REPO_ROOT = str(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
40
 
41
  return [
42
- [os.path.join(REPO_ROOT, 'examples/cxk.mp4'), 'Static Camera', 60],
43
- [os.path.join(REPO_ROOT, 'examples/tennis.mp4'), 'Static Camera', 60],
44
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  REPO_ROOT = str(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
40
 
41
  return [
42
+ [os.path.join(REPO_ROOT, 'examples/cxk.mp4'), 'Static Camera', 120],
43
+ [os.path.join(REPO_ROOT, 'examples/tennis.mp4'), 'Static Camera', 120],
44
  ]
45
+
46
+
47
+ def get_desc():
48
+ return '''
49
+ <center><b><font size='10'><font color='78aa58'>G</font><font color='6589bf'>V</font>HMR</font></b></center>
50
+
51
+ <center><b><font size='5'> World-Grounded Human Motion Recovery via <font color='78aa58'>Gravity</font>-<font color='6589bf'>View</font> <font color='c68b5b'>Coordinates</font></font></b></center>
52
+
53
+ ![](https://zju3dv.github.io/gvhmr/img/teaser_v1.png)
54
+
55
+ <center><b>
56
+ <a href=https://zju3dv.github.io/gvhmr>Project Page</a>
57
+ |
58
+ <a href=https://arxiv.org/abs/2409.06662>Paper</a>
59
+ </b></center>
60
+
61
+ > World-Grounded Human Motion Recovery via Gravity-View Coordinates
62
+ > [Zehong Shen](https://zehongs.github.io/)<sup>\*</sup>,
63
+ [Huaijin Pi](https://phj128.github.io/)<sup>\*</sup>,
64
+ [Yan Xia](https://isshikihugh.github.io/scholar),
65
+ [Zhi Cen](https://scholar.google.com/citations?user=Xyy-uFMAAAAJ),
66
+ [Sida Peng](https://pengsida.net/)<sup>†</sup>,
67
+ [Zechen Hu](https://zju3dv.github.io/gvhmr),
68
+ [Hujun Bao](http://www.cad.zju.edu.cn/home/bao/),
69
+ [Ruizhen Hu](https://csse.szu.edu.cn/staff/ruizhenhu/),
70
+ [Xiaowei Zhou](https://xzhou.me/)
71
+ > SIGGRAPH Asia 2024
72
+ '''
app/handler.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
 
4
  from omegaconf import OmegaConf
5
 
6
- from .demo import *
7
 
8
 
9
  def prepare_cfg(is_static:bool, video_path:str, demo_id:str):
@@ -44,7 +44,7 @@ def prepare_cfg(is_static:bool, video_path:str, demo_id:str):
44
  def run_demo(cfg, progress, GPU_quota):
45
  ''' Allow user to adjust GPU quota. '''
46
 
47
- @spaces.GPU(duration=GPU_quota)
48
  def run_GPU_task():
49
  paths = cfg.paths
50
  Log.info(f"[GPU]: {torch.cuda.get_device_name()}")
 
3
 
4
  from omegaconf import OmegaConf
5
 
6
+ from app.demo import *
7
 
8
 
9
  def prepare_cfg(is_static:bool, video_path:str, demo_id:str):
 
44
  def run_demo(cfg, progress, GPU_quota):
45
  ''' Allow user to adjust GPU quota. '''
46
 
47
+ @spaces.GPU(duration=int(GPU_quota))
48
  def run_GPU_task():
49
  paths = cfg.paths
50
  Log.info(f"[GPU]: {torch.cuda.get_device_name()}")