Skip to content

Commit

Permalink
[Fix] Fix datasets unittest (#3078)
Browse files Browse the repository at this point in the history
* --fix=fix datasets unittest

* --fix=remove pring
  • Loading branch information
xiexinch committed Jul 12, 2024
1 parent 08bf67b commit 168e668
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
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])

0 comments on commit 168e668

Please sign in to comment.