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] Improve MultiImageMixDataset unittests coverage #1197

Merged
merged 24 commits into from
Jan 22, 2022
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Add unittest in test_build_dataset
lkm2835 committed Dec 11, 2021

Verified

This commit was signed with the committer’s verified signature.
commit 08b5c3350c39e1b79df59d30df4629c99b8b4b93
9 changes: 7 additions & 2 deletions tests/test_data/test_dataset_builder.py
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@
from torch.utils.data import (DistributedSampler, RandomSampler,
SequentialSampler)

from mmseg.datasets import (DATASETS, ConcatDataset, build_dataloader,
build_dataset)
from mmseg.datasets import (DATASETS, ConcatDataset, MultiImageMixDataset,
build_dataloader, build_dataset)


@DATASETS.register_module()
@@ -48,6 +48,11 @@ def test_build_dataset():
assert isinstance(dataset, ConcatDataset)
assert len(dataset) == 10

cfg = dict(type='MultiImageMixDataset', dataset=cfg, pipeline=[])
dataset = build_dataset(cfg)
assert isinstance(dataset, MultiImageMixDataset)
assert len(dataset) == 10

# with ann_dir, split
cfg = dict(
type='CustomDataset',