diff --git a/mmhuman3d/data/data_converters/sminchisescu.py b/mmhuman3d/data/data_converters/sminchisescu.py index 7d9da371..09c9cbf2 100644 --- a/mmhuman3d/data/data_converters/sminchisescu.py +++ b/mmhuman3d/data/data_converters/sminchisescu.py @@ -292,9 +292,10 @@ def convert_by_mode(self, dataset_path: str, out_path: str, ]: bboxs_[bbox_name] = [] meta_ = {} - for meta_key in ['focal_length', 'principal_point']: + for meta_key in ['RT', 'focal_length', 'principal_point', 'sequence_name']: meta_[meta_key] = [] image_path_ = [] + sids = [] for vid_p in tqdm( vid_ps[slice_vids * slice_idx:slice_vids * @@ -308,6 +309,9 @@ def convert_by_mode(self, dataset_path: str, out_path: str, else: subj_ids = [0] + # if 'hug 6' not in vid_p: + # continue + for subj_id in subj_ids: subject = 'w_markers' if subj_id == 0 else 'wo_markers' @@ -472,6 +476,9 @@ def convert_by_mode(self, dataset_path: str, out_path: str, keypoints_2d_original) keypoints_3d_original_.append( keypoints_3d_original) + + sids += [subj_id] * len(image_path) + # write meta meta_['focal_length'] += cam_params[ @@ -480,6 +487,8 @@ def convert_by_mode(self, dataset_path: str, out_path: str, meta_['principal_point'] += cam_params[ 'intrinsics_w_distortion']['c'].repeat( len(image_path)).tolist() + meta_['sequence_name'] += [os.path.basename(vid_p) + f'_{subj_id}'] * len(image_path) + meta_['RT'] += [extrinsics] * len(image_path) # write image path image_path_ += image_path @@ -554,6 +563,7 @@ def convert_by_mode(self, dataset_path: str, out_path: str, 'keypoints3d_original_mask'] = keypoints_3d_original_mask # meta + meta_['subject_id'] = sids human_data['meta'] = meta_ # image path