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 a bug in BaseDataset when data_prefix is None #314

Merged
merged 2 commits into from
Nov 6, 2020
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
13 changes: 13 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
## Changelog

###v 0.9.0 (master)

**Highlights**

**New Features**

**Improvements**

**Bug Fixes**
- Fix a bug in BaseDataset when `data_prefix` is None ([#314](https://github.com/open-mmlab/mmaction2/pull/314))

**ModelZoo**

### v0.8.0 (31/10/2020)

**Highlights**
Expand Down
5 changes: 3 additions & 2 deletions mmaction/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ def __init__(self,
super().__init__()

self.ann_file = ann_file
self.data_prefix = osp.realpath(data_prefix) if osp.isdir(
data_prefix) else data_prefix
self.data_prefix = osp.realpath(
data_prefix) if data_prefix is not None and osp.isdir(
data_prefix) else data_prefix
self.test_mode = test_mode
self.multi_class = multi_class
self.num_classes = num_classes
Expand Down
4 changes: 4 additions & 0 deletions tests/test_data/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ def test_dataset_realpath(self):
's3://good')
assert dataset.data_prefix == 's3://good'

dataset = RawframeDataset(self.frame_ann_file, self.frame_pipeline)
assert dataset.data_prefix is None
assert dataset.video_infos[0]['frame_dir'] == 'test_imgs'

def test_video_dataset(self):
video_dataset = VideoDataset(
self.video_ann_file,
Expand Down