From ec86a3b565b0822e07c39e2a451a0fd2d89c52d5 Mon Sep 17 00:00:00 2001 From: Jeff-sjtu Date: Fri, 25 Nov 2022 13:57:42 +0800 Subject: [PATCH] update models --- README.md | 14 ++++ ..._adam_lr1e-3-hrw48_cam_2x_w_pw3d_3dhp.yaml | 2 +- ...x192_adam_lr1e-3-hrw48_cam_2x_wo_pw3d.yaml | 79 +++++++++++++++++++ .../presets/simple_transform_3d_smpl_cam.py | 37 +++++---- 4 files changed, 115 insertions(+), 17 deletions(-) create mode 100644 configs/256x192_adam_lr1e-3-hrw48_cam_2x_wo_pw3d.yaml diff --git a/README.md b/README.md index 3208887..33262be 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,20 @@ Download the pretrained model ([ResNet-34](https://drive.google.com/file/d/16Y_M +## 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: diff --git a/configs/256x192_adam_lr1e-3-hrw48_cam_2x_w_pw3d_3dhp.yaml b/configs/256x192_adam_lr1e-3-hrw48_cam_2x_w_pw3d_3dhp.yaml index 51946a0..6b73087 100644 --- a/configs/256x192_adam_lr1e-3-hrw48_cam_2x_w_pw3d_3dhp.yaml +++ b/configs/256x192_adam_lr1e-3-hrw48_cam_2x_w_pw3d_3dhp.yaml @@ -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: '' diff --git a/configs/256x192_adam_lr1e-3-hrw48_cam_2x_wo_pw3d.yaml b/configs/256x192_adam_lr1e-3-hrw48_cam_2x_wo_pw3d.yaml new file mode 100644 index 0000000..b8dd6ee --- /dev/null +++ b/configs/256x192_adam_lr1e-3-hrw48_cam_2x_wo_pw3d.yaml @@ -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 diff --git a/hybrik/utils/presets/simple_transform_3d_smpl_cam.py b/hybrik/utils/presets/simple_transform_3d_smpl_cam.py index 8f62dad..9b77a48 100644 --- a/hybrik/utils/presets/simple_transform_3d_smpl_cam.py +++ b/hybrik/utils/presets/simple_transform_3d_smpl_cam.py @@ -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)) @@ -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)) @@ -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: @@ -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: