Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Fix datasets unittest #3078

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mmpose/datasets/datasets/wholebody3d/h3wb_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def _load_annotations(self) -> Tuple[List[dict], List[dict]]:

instance_id = 0
for subject in self.subjects:
if subject not in self.ann_data:
continue
actions = self.ann_data[subject].keys()
for act in actions:
for cam in self.camera_order_id:
Expand Down
2 changes: 1 addition & 1 deletion mmpose/datasets/datasets/wholebody3d/ubody3d_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self,

super().__init__(multiple_target=multiple_target, **kwargs)

METAINFO: dict = dict(from_file='configs/_base_/datasets/h3wb.py')
METAINFO: dict = dict(from_file='configs/_base_/datasets/ubody3d.py')

def _load_ann_file(self, ann_file: str) -> dict:
"""Load annotation file."""
Expand Down
Binary file removed tests/data/h3wb/h3wb_train_sub.npz
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/data/ubody3d/ubody3d_train.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TestH36MWholeBodyDataset(TestCase):
def build_h3wb_dataset(self, **kwargs):

cfg = dict(
ann_file='h3wb_train_sub.npz',
ann_file='h3wb_train_bbox_subset.npz',
data_mode='topdown',
data_root='tests/data/h3wb',
pipeline=[])
Expand Down Expand Up @@ -54,12 +54,6 @@ def test_topdown(self):
# test topdown training
dataset = self.build_h3wb_dataset(data_mode='topdown')
dataset.full_init()
self.assertEqual(len(dataset), 3)
self.check_data_info_keys(dataset[0])

# test topdown testing
dataset = self.build_h3wb_dataset(data_mode='topdown', test_mode=True)
dataset.full_init()
self.assertEqual(len(dataset), 1)
self.check_data_info_keys(dataset[0])

Expand All @@ -71,5 +65,5 @@ def test_topdown(self):
causal=False,
pad_video_seq=True)
dataset.full_init()
self.assertEqual(len(dataset), 3)
self.assertEqual(len(dataset), 1)
self.check_data_info_keys(dataset[0])
Loading