Skip to content

Commit c9a0196

Browse files
authored
updated with correct codes
1 parent cc752f1 commit c9a0196

File tree

3 files changed

+240
-3
lines changed

3 files changed

+240
-3
lines changed

environment.yml

+228
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
name: hybrik
2+
channels:
3+
- pytorch3d
4+
- pytorch
5+
- bottler
6+
- iopath
7+
- anaconda
8+
- conda-forge
9+
- nvidia
10+
- defaults
11+
dependencies:
12+
- _libgcc_mutex=0.1=main
13+
- _openmp_mutex=5.1=1_gnu
14+
- blas=1.0=mkl
15+
- brotli-python=1.0.9=py39h6a678d5_7
16+
- bzip2=1.0.8=h7b6447c_0
17+
- c-ares=1.19.1=h5eee18b_0
18+
- ca-certificates=2023.08.22=h06a4308_0
19+
- certifi=2023.7.22=py39h06a4308_0
20+
- cffi=1.15.1=py39h5eee18b_3
21+
- charset-normalizer=2.0.4=pyhd3eb1b0_0
22+
- cryptography=41.0.3=py39hdda0065_0
23+
- cuda=11.6.1=0
24+
- cuda-cccl=11.6.55=hf6102b2_0
25+
- cuda-command-line-tools=11.6.2=0
26+
- cuda-compiler=11.6.2=0
27+
- cuda-cudart=11.6.55=he381448_0
28+
- cuda-cudart-dev=11.6.55=h42ad0f4_0
29+
- cuda-cuobjdump=11.6.124=h2eeebcb_0
30+
- cuda-cupti=11.6.124=h86345e5_0
31+
- cuda-cuxxfilt=11.6.124=hecbf4f6_0
32+
- cuda-driver-dev=11.6.55=0
33+
- cuda-gdb=12.3.52=0
34+
- cuda-libraries=11.6.1=0
35+
- cuda-libraries-dev=11.6.1=0
36+
- cuda-memcheck=11.8.86=0
37+
- cuda-nsight=12.3.52=0
38+
- cuda-nsight-compute=12.3.0=0
39+
- cuda-nvcc=11.6.124=hbba6d2d_0
40+
- cuda-nvdisasm=12.3.52=0
41+
- cuda-nvml-dev=11.6.55=haa9ef22_0
42+
- cuda-nvprof=12.3.52=0
43+
- cuda-nvprune=11.6.124=he22ec0a_0
44+
- cuda-nvrtc=11.6.124=h020bade_0
45+
- cuda-nvrtc-dev=11.6.124=h249d397_0
46+
- cuda-nvtx=11.6.124=h0630a44_0
47+
- cuda-nvvp=12.3.52=0
48+
- cuda-runtime=11.6.1=0
49+
- cuda-samples=11.6.101=h8efea70_0
50+
- cuda-sanitizer-api=12.3.52=0
51+
- cuda-toolkit=11.6.1=0
52+
- cuda-tools=11.6.1=0
53+
- cuda-visual-tools=11.6.1=0
54+
- curl=7.88.1=hdbd6064_2
55+
- expat=2.5.0=h6a678d5_0
56+
- ffmpeg=4.2.2=h20bf706_0
57+
- freetype=2.12.1=h4a9f257_0
58+
- fvcore=0.1.5.post20221221=pyhd8ed1ab_0
59+
- gdbm=1.18=hd4cb3f1_4
60+
- gds-tools=1.8.0.34=0
61+
- gettext=0.21.0=h39681ba_1
62+
- giflib=5.2.1=h5eee18b_3
63+
- git=2.40.1=pl5340h36fbf9e_1
64+
- gmp=6.2.1=h295c915_3
65+
- gnutls=3.6.15=he1e5248_0
66+
- icu=73.1=h6a678d5_0
67+
- idna=3.4=py39h06a4308_0
68+
- intel-openmp=2023.1.0=hdb19cb5_46305
69+
- iopath=0.1.9=py39
70+
- jpeg=9e=h5eee18b_1
71+
- krb5=1.20.1=h143b758_1
72+
- lame=3.100=h7b6447c_0
73+
- lcms2=2.12=h3be6417_0
74+
- ld_impl_linux-64=2.38=h1181459_1
75+
- lerc=3.0=h295c915_0
76+
- libcublas=11.9.2.110=h5e84587_0
77+
- libcublas-dev=11.9.2.110=h5c901ab_0
78+
- libcufft=10.7.1.112=hf425ae0_0
79+
- libcufft-dev=10.7.1.112=ha5ce4c0_0
80+
- libcufile=1.8.0.34=0
81+
- libcufile-dev=1.8.0.34=0
82+
- libcurand=10.3.4.52=0
83+
- libcurand-dev=10.3.4.52=0
84+
- libcurl=7.88.1=h251f7ec_2
85+
- libcusolver=11.3.4.124=h33c3c4e_0
86+
- libcusparse=11.7.2.124=h7538f96_0
87+
- libcusparse-dev=11.7.2.124=hbbe9722_0
88+
- libdeflate=1.17=h5eee18b_1
89+
- libedit=3.1.20221030=h5eee18b_0
90+
- libev=4.33=h7f8727e_1
91+
- libffi=3.4.4=h6a678d5_0
92+
- libgcc-ng=11.2.0=h1234567_1
93+
- libgomp=11.2.0=h1234567_1
94+
- libidn2=2.3.4=h5eee18b_0
95+
- libnghttp2=1.57.0=h2d74bed_0
96+
- libnpp=11.6.3.124=hd2722f0_0
97+
- libnpp-dev=11.6.3.124=h3c42840_0
98+
- libnvjpeg=11.6.2.124=hd473ad6_0
99+
- libnvjpeg-dev=11.6.2.124=hb5906b9_0
100+
- libopus=1.3.1=h7b6447c_0
101+
- libpng=1.6.39=h5eee18b_0
102+
- libssh2=1.10.0=hdbd6064_2
103+
- libstdcxx-ng=11.2.0=h1234567_1
104+
- libtasn1=4.19.0=h5eee18b_0
105+
- libtiff=4.5.1=h6a678d5_0
106+
- libunistring=0.9.10=h27cfd23_0
107+
- libvpx=1.7.0=h439df22_0
108+
- libwebp=1.3.2=h11a3e52_0
109+
- libwebp-base=1.3.2=h5eee18b_0
110+
- libxml2=2.10.4=hf1b16e4_1
111+
- lz4-c=1.9.4=h6a678d5_0
112+
- mkl=2023.1.0=h213fc3f_46343
113+
- mkl-service=2.4.0=py39h5eee18b_1
114+
- mkl_fft=1.3.8=py39h5eee18b_0
115+
- mkl_random=1.2.4=py39hdb19cb5_0
116+
- ncurses=6.4=h6a678d5_0
117+
- nettle=3.7.3=hbbd107a_1
118+
- nsight-compute=2023.3.0.12=0
119+
- nvidiacub=1.10.0=0
120+
- openh264=2.1.1=h4ff587b_0
121+
- openjpeg=2.4.0=h3ad879b_0
122+
- openssl=3.0.12=h7f8727e_0
123+
- pcre2=10.42=hebb0a14_0
124+
- perl=5.34.0=h5eee18b_2
125+
- pip=23.3=py39h06a4308_0
126+
- portalocker=2.3.0=py39h06a4308_1
127+
- pycparser=2.21=pyhd3eb1b0_0
128+
- pyopenssl=23.2.0=py39h06a4308_0
129+
- pysocks=1.7.1=py39h06a4308_0
130+
- python=3.9.18=h955ad1f_0
131+
- python_abi=3.9=2_cp39
132+
- pytorch=1.13.0=py3.9_cuda11.6_cudnn8.3.2_0
133+
- pytorch-cuda=11.6=h867d48c_1
134+
- pytorch-mutex=1.0=cuda
135+
- pytorch3d=0.7.5=py39_cu116_pyt1130
136+
- readline=8.2=h5eee18b_0
137+
- requests=2.31.0=py39h06a4308_0
138+
- setuptools=68.0.0=py39h06a4308_0
139+
- sqlite=3.41.2=h5eee18b_0
140+
- tabulate=0.8.10=py39h06a4308_0
141+
- tbb=2021.8.0=hdb19cb5_0
142+
- termcolor=2.1.0=py39h06a4308_0
143+
- tk=8.6.12=h1ccaba5_0
144+
- torchvision=0.14.0=py39_cu116
145+
- tqdm=4.65.0=py39hb070fc8_0
146+
- typing_extensions=4.7.1=py39h06a4308_0
147+
- urllib3=1.26.18=py39h06a4308_0
148+
- wheel=0.41.2=py39h06a4308_0
149+
- x264=1!157.20191217=h7b6447c_0
150+
- xz=5.4.2=h5eee18b_0
151+
- yacs=0.1.6=pyhd3eb1b0_1
152+
- yaml=0.2.5=h7b6447c_0
153+
- zlib=1.2.13=h5eee18b_0
154+
- zstd=1.5.5=hc292b87_0
155+
- pip:
156+
- aiohttp==3.8.6
157+
- aiosignal==1.3.1
158+
- appdirs==1.4.4
159+
- async-timeout==4.0.3
160+
- attrs==23.1.0
161+
- autograd==1.6.2
162+
- beautifulsoup4==4.12.2
163+
- contourpy==1.2.0
164+
- cycler==0.12.1
165+
- cython==3.0.5
166+
- dill==0.3.7
167+
- ffmpeg-python==0.2.0
168+
- fonttools==4.44.0
169+
- frozenlist==1.4.0
170+
- fsspec==2023.10.0
171+
- future==0.18.3
172+
- h5py==3.1.0
173+
- imageio==2.32.0
174+
- importlib-metadata==6.8.0
175+
- importlib-resources==6.1.1
176+
- imutils==0.5.4
177+
- joblib==1.3.2
178+
- kiwisolver==1.4.5
179+
- lazy-loader==0.3
180+
- lightning-utilities==0.9.0
181+
- llvmlite==0.41.1
182+
- lmdb==1.4.1
183+
- markupsafe==2.1.3
184+
- matplotlib==3.8.1
185+
- meshio==4.4.6
186+
- multidict==6.0.4
187+
- multiprocess==0.70.15
188+
- networkx==3.2.1
189+
- numba==0.58.1
190+
- numpy==1.23.1
191+
- opencv-python==4.8.1.78
192+
- opendr==0.77
193+
- packaging==23.2
194+
- pandas==2.1.2
195+
- pathos==0.3.1
196+
- pillow==10.1.0
197+
- pox==0.3.3
198+
- ppft==1.7.6.7
199+
- progress==1.6
200+
- protobuf==3.19.6
201+
- pydeprecate==0.3.0
202+
- pynvml==11.5.0
203+
- pyparsing==3.1.1
204+
- python-dateutil==2.8.2
205+
- python-graphviz==0.20.1
206+
- pytorch-lightning==0.8.3
207+
- pytube==15.0.0
208+
- pytz==2023.3.post1
209+
- pyvista==0.36.0
210+
- pyyaml==5.4.1
211+
- scikit-image==0.22.0
212+
- scikit-learn==1.3.2
213+
- scipy==1.11.3
214+
- scooby==0.9.2
215+
- seaborn==0.13.0
216+
- six==1.16.0
217+
- soupsieve==2.5
218+
- tb-nightly==2.16.0a20231108
219+
- threadpoolctl==3.2.0
220+
- tifffile==2023.9.26
221+
- torchmetrics==1.2.0
222+
- transforms3d==0.3.1
223+
- tzdata==2023.3
224+
- vtk==9.1.0
225+
- werkzeug==3.0.1
226+
- wslink==1.12.4
227+
- yarl==1.9.2
228+
- zipp==3.17.0

global_recon/models/global_recon_model.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import torch
44
import numpy as np
5+
from scipy.spatial.transform import Rotation as R
56
from scipy.interpolate import interp1d
67
from lib.models.smpl import SMPL, SMPL_MODEL_DIR
78
from lib.utils.geometry import perspective_projection
@@ -99,7 +100,14 @@ def init_data(self, in_dict):
99100
new_dict['invis_frames'] = invis_frames = visible == 0
100101
new_dict['frame2ind'] = {f: i for i, f in enumerate(new_dict['frames'])}
101102
new_dict['scale'] = None
102-
smpl_pose_wroot = quaternion_to_angle_axis(torch.tensor(pose_dict[f'smpl_pose_quat_wroot'], device=self.device)).cpu().numpy()
103+
104+
## Credits: https://github.com/NVlabs/GLAMR/issues/34#issuecomment-1671664667
105+
hybrik_poses_rot = pose_dict['smpl_pose_quat_wroot']
106+
batch_size = hybrik_poses_rot.shape[0]
107+
smpl_pose_wroot = R.as_rotvec(R.from_matrix(hybrik_poses_rot.reshape((-1, 3, 3)))).reshape((batch_size, -1, 3))
108+
smpl_pose_wroot = smpl_pose_wroot.astype(np.float32)
109+
# smpl_pose_wroot = quaternion_to_angle_axis(torch.tensor(pose_dict[f'smpl_pose_quat_wroot'], device=self.device)).cpu().numpy()
110+
# new_dict['smpl_pose'] = smpl_pose_wroot[:, 1:].reshape(-1, 69)
103111
new_dict['smpl_pose'] = smpl_pose_wroot[:, 1:].reshape(-1, 69)
104112
if idx in in_dict['gt']:
105113
new_dict['smpl_pose_gt'] = in_dict['gt'][idx]['pose'][:, 3:]

global_recon/run_demo.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@
110110
visualizer = GReconVisualizer(out_dict, coord='world', verbose=False, show_camera=False,
111111
render_cam_pos=render_specs.get('cam_pos', None), render_cam_focus=render_specs.get('cam_focus', None))
112112
visualizer.save_animation_as_video(video_world, window_size=render_specs.get('wsize', (int(1.5 * img_h), img_h)), cleanup=True, crf=5)
113-
113+
print(f'Saved results at: {video_world}')
114114
log.info(f'saving cam animation for {seq_name}')
115115
visualizer = GReconVisualizer(out_dict, coord='cam_in_world', verbose=False, background_img_dir=frame_dir)
116116
visualizer.save_animation_as_video(video_cam, window_size=(img_w, img_h), cleanup=True)
117117

118118
log.info(f'saving side-by-side animation for {seq_name}')
119-
hstack_video_arr([pose_est_video, video_cam, video_world], video_sbs, text_arr=[pose_est_model_name, 'GLAMR (Cam)', 'GLAMR (World)'], text_color='blue', text_size=img_h // 16, verbose=False)
119+
hstack_video_arr([pose_est_video, video_cam, video_world], video_sbs, verbose=False)
120+
print(f'Saved results at: {video_sbs}')

0 commit comments

Comments
 (0)