Skip to content

Commit 89e98ab

Browse files
committed
fix: fix issues and pin dep versions
1 parent e41ca1d commit 89e98ab

24 files changed

+3625
-8
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ celerybeat.pid
111111
# Environments
112112
.env
113113
.venv
114-
env/
114+
# env/
115115
venv/
116116
ENV/
117117
env.bak/

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ To set up the environment, follow these steps:
2222
conda create -n cgf python=3.10 -y && conda activate cgf
2323
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia -y
2424

25-
pip install six numpy==1.23.1 tqdm pyyaml scipy opencv-python trimesh einops lxml transforms3d viser fvcore
25+
pip install six numpy==1.23.1 tqdm pyyaml scipy opencv-python trimesh einops lxml transforms3d fvcore viser==0.1.34
2626
pip install git+https://github.com/hassony2/chumpy.git
2727
pip install git+https://github.com/hassony2/manopth
28-
pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cu117_pyt1131/download.html
29-
# the above command is for pytorch 1.13.1, CUDA 11.7, python 3.10, if you encounter any issues, please try install pytorch3d from source:
30-
# pip install git+https://github.com/facebookresearch/pytorch3d.git
28+
pip install git+https://github.com/facebookresearch/pytorch3d.git@v0.7.3
29+
# installing pytorch3d from source is usually more robust, for pytorch 1.13.1, CUDA 11.7, python 3.10, the following command *may* work:
30+
# pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cu117_pyt1131/download.html
3131

32-
pip install git+https://github.com/UM-ARM-Lab/pytorch_kinematics
32+
pip install git+https://github.com/UM-ARM-Lab/pytorch_kinematics.git@v0.6.1
3333
```
3434

3535
## Data Preparation

cgf/transformation.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
import numpy as np
55
import torch
66
import torch.nn.functional as F
7+
8+
# fix for chumpy
9+
np.bool = np.bool_
10+
np.int = np.int_
11+
np.float = np.float_
12+
np.complex = np.complex_
13+
np.object = np.object_
14+
np.str = np.str_
15+
716
from manopth.manolayer import ManoLayer
817
from scipy.spatial.transform import Rotation as Rot
918

@@ -103,7 +112,12 @@ def quaternion_to_matrix(quaternions):
103112
"""
104113
if isinstance(quaternions, np.ndarray) or isinstance(quaternions, list) or isinstance(quaternions, tuple):
105114
quaternions = np.asarray(quaternions)
106-
r, i, j, k = quaternions[..., 0], quaternions[..., 1], quaternions[..., 2], quaternions[..., 3]
115+
r, i, j, k = (
116+
quaternions[..., 0],
117+
quaternions[..., 1],
118+
quaternions[..., 2],
119+
quaternions[..., 3],
120+
)
107121
two_s = 2.0 / (quaternions * quaternions).sum(-1)
108122
matrices = np.stack(
109123
[
@@ -359,7 +373,13 @@ class ManoTransformation:
359373
def __init__(self, side, mano_root):
360374
with warnings.catch_warnings():
361375
warnings.simplefilter("ignore", UserWarning)
362-
self.mano_layer = ManoLayer(flat_hand_mean=False, ncomps=45, side=side, mano_root=mano_root, use_pca=True)
376+
self.mano_layer = ManoLayer(
377+
flat_hand_mean=False,
378+
ncomps=45,
379+
side=side,
380+
mano_root=mano_root,
381+
use_pca=True,
382+
)
363383

364384
def transform_pose(self, pose, betas, tf_mat=None, quat=None, tl=None):
365385
assert tf_mat is not None or (quat is not None and tl is not None), "incorrect params"

0 commit comments

Comments
 (0)