Skip to content

Commit

Permalink
update models
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff-sjtu committed Nov 25, 2022
1 parent 4f9db18 commit ec86a3b
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 17 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ Download the pretrained model ([ResNet-34](https://drive.google.com/file/d/16Y_M

</center>

## MODEL ZOO

| Backbone | Training Data | PA-MPJPE (3DPW) | MPJPE (3DPW) | PA-MPJPE (Human3.6M) | MPJPE (Human3.6M) | Download | Config |
|----------|----------|------------|------------|-------|-----------|--------|--------------|
| ResNet-34 | w/o 3DPW | | | | | [model]() | [cfg]() |
| ResNet-34 | w/ 3DPW | 44.5 | 72.4 | 33.8 | 55.5 | [model](https://drive.google.com/file/d/19ktHbERz0Un5EzJYZBdzdzTrFyd9gLCx/view?usp=share_link) | [cfg](./configs/256x192_adam_lr1e-3-res34_smpl_3d_cam_2x_mix_w_pw3d.yaml) |
| HRNet-W48 | w/o 3DPW | 48.6 | 88.0 | 29.5 | 50.4 | [model](https://drive.google.com/file/d/1o3z99bebm2XImElc3XEUzTNVhQboGJE9/view?usp=share_link) | [cfg](./configs/256x192_adam_lr1e-3-hrw48_cam_2x_wo_pw3d.yaml) |
| HRNet-W48 | w/ 3DPW | 41.8 | 71.3 | 29.8 | 47.1 | [model](https://drive.google.com/file/d/1gp3549vIEKfbc8SDQ-YF3Idi1aoR3DkW/view?usp=share_link) | [cfg](configs/256x192_adam_lr1e-3-hrw48_cam_2x_w_pw3d_3dhp.yaml) |


#### Notes
- All models assume a fixed focal length and predict camera parameters.
- Flip test is used by default.


## Citing
If our code helps your research, please consider citing the following paper:
Expand Down
2 changes: 1 addition & 1 deletion configs/256x192_adam_lr1e-3-hrw48_cam_2x_w_pw3d_3dhp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DATASET:
MODEL:
TYPE: 'HRNetSMPLCam'
HR_PRETRAINED: './pose_hrnet_w48_256x192.pth'
PRETRAINED: './exp/hrnetw48_ckpt13.pth'
PRETRAINED: ''
# TRY_LOAD: ''
TRY_LOAD: ''
RESUME: ''
Expand Down
79 changes: 79 additions & 0 deletions configs/256x192_adam_lr1e-3-hrw48_cam_2x_wo_pw3d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
DATASET:
DATASET: 'mix_smpl_cam'
SET_LIST:
- ROOT: './data/h36m/'
TEST_SET: 'Sample_20_test_Human36M_smpl'
TRAIN_SET: 'Sample_trainmin_train_Human36M_smpl_leaf_twist'
- ROOT: './data/coco/'
TRAIN_SET: 'train2017'
- ROOT: './data/3dhp/'
TRAIN_SET: 'train_v2'
PROTOCOL: 2
FLIP: True
ROT_FACTOR: 30
SCALE_FACTOR: 0.3
NUM_JOINTS_HALF_BODY: 8
PROB_HALF_BODY: -1
COLOR_FACTOR: 0.2
OCCLUSION: True
MODEL:
TYPE: 'HRNetSMPLCam'
HR_PRETRAINED: './pose_hrnet_w48_256x192.pth'
PRETRAINED: ''
# TRY_LOAD: ''
TRY_LOAD: ''
RESUME: ''
FOCAL_LENGTH: 1000
IMAGE_SIZE:
- 256
- 256
HEATMAP_SIZE:
- 64
- 64
NUM_JOINTS: 29
HRNET_TYPE: 48
EXTRA:
SIGMA: 2
BACKBONE: 'resnet'
CROP: 'padding'
AUGMENT: 'none'
PRESET: 'simple_smpl_3d_cam'
DEPTH_DIM: 64
POST:
NORM_TYPE: 'softmax'
BBOX_3D_SHAPE:
- 2200
- 2200
- 2200
LOSS:
TYPE: 'LaplaceLossDimSMPLCam'
ELEMENTS:
BETA_WEIGHT: 1
BETA_REG_WEIGHT: 0
PHI_REG_WEIGHT: 0.0001
LEAF_REG_WEIGHT: 0
TWIST_WEIGHT: 1
THETA_WEIGHT: 0.01
UVD24_WEIGHT: 1
XYZ24_WEIGHT: 0
XYZ_SMPL24_WEIGHT: 0
XYZ_SMPL17_WEIGHT: 0
VERTICE_WEIGHT: 0
USE_LAPLACE: True
TEST:
HEATMAP2COORD: 'coord'
TRAIN:
WORLD_SIZE: 4
BATCH_SIZE: 36
BEGIN_EPOCH: 0
END_EPOCH: 200
OPTIMIZER: 'adam'
LR: 0.001
LR_FACTOR: 0.1
LR_STEP:
- 60
- 80
DPG_MILESTONE: 140
DPG_STEP:
- 160
- 190
37 changes: 21 additions & 16 deletions hybrik/utils/presets/simple_transform_3d_smpl_cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ def _integral_target_generator(self, joints_3d, num_joints, patch_height, patch_
target[:, 1] = joints_3d[:, 1, 0] / patch_height - 0.5
target[:, 2] = joints_3d[:, 2, 0] / self.bbox_3d_shape[0]

target_weight[target[:, 0] > 0.5] = 0
target_weight[target[:, 0] < -0.5] = 0
target_weight[target[:, 1] > 0.5] = 0
target_weight[target[:, 1] < -0.5] = 0
target_weight[target[:, 2] > 0.5] = 0
target_weight[target[:, 2] < -0.5] = 0
# target_weight[target[:, 0] > 0.5] = 0
# target_weight[target[:, 0] < -0.5] = 0
# target_weight[target[:, 1] > 0.5] = 0
# target_weight[target[:, 1] < -0.5] = 0
# target_weight[target[:, 2] > 0.5] = 0
# target_weight[target[:, 2] < -0.5] = 0

target = target.reshape((-1))
target_weight = target_weight.reshape((-1))
Expand All @@ -208,12 +208,12 @@ def _integral_uvd_target_generator(self, joints_3d, num_joints, patch_height, pa
target[:, 1] = joints_3d[:, 1, 0] / patch_height - 0.5
target[:, 2] = joints_3d[:, 2, 0] / self.bbox_3d_shape[2]

target_weight[target[:, 0] > 0.5] = 0
target_weight[target[:, 0] < -0.5] = 0
target_weight[target[:, 1] > 0.5] = 0
target_weight[target[:, 1] < -0.5] = 0
target_weight[target[:, 2] > 0.5] = 0
target_weight[target[:, 2] < -0.5] = 0
# target_weight[target[:, 0] > 0.5] = 0
# target_weight[target[:, 0] < -0.5] = 0
# target_weight[target[:, 1] > 0.5] = 0
# target_weight[target[:, 1] < -0.5] = 0
# target_weight[target[:, 2] > 0.5] = 0
# target_weight[target[:, 2] < -0.5] = 0

target = target.reshape((-1))
target_weight = target_weight.reshape((-1))
Expand Down Expand Up @@ -401,8 +401,13 @@ def __call__(self, src, label):

# half body transform
if self._train and (np.sum(joints_vis_17[:, 0]) > self.num_joints_half_body and np.random.rand() < self.prob_half_body):
# self.num_joints = 17
# c_half_body, s_half_body = self.half_body_transform(
# gt_joints_17[:, :, 0], joints_vis_17
# )
self.num_joints = 24
c_half_body, s_half_body = self.half_body_transform(
gt_joints_17[:, :, 0], joints_vis_17
gt_joints_29[:, :, 0], joints_vis_29
)

if c_half_body is not None and s_half_body is not None:
Expand Down Expand Up @@ -513,9 +518,9 @@ def __call__(self, src, label):

if self.focal_length > 0:
cam_scale, cam_trans, cam_valid, cam_error, new_uvd = self.calc_cam_scale_trans2(
target_xyz_24.reshape(-1, 3).copy(),
tmp_uvd_24.copy(),
tmp_uvd_24_weight.copy())
target_xyz_24.reshape(-1, 3).copy(),
tmp_uvd_24.copy(),
tmp_uvd_24_weight.copy())

target_uvd_29 = (target_uvd_29 * target_weight_29).reshape(-1, 3)
else:
Expand Down

0 comments on commit ec86a3b

Please sign in to comment.