Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Wei-Chen-hub committed May 24, 2024
1 parent 5177b1a commit 1608872
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mmhuman3d/data/data_converters/sminchisescu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand All @@ -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'
Expand Down Expand Up @@ -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[
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1608872

Please sign in to comment.