-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"annotations": [{"image_id": 9, "caption": "a good meal"}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"annotations": [{"image_id": 42, "caption": "a pair of slippers"}] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
import os | ||
from pathlib import Path | ||
|
||
|
||
from mmedit.datasets import MSCoCoDataset | ||
|
||
|
||
class TestMSCoCoDatasets: | ||
|
||
@classmethod | ||
def setup_class(cls): | ||
cls.data_root = Path(__file__).parent.parent / 'data' / 'coco' | ||
|
||
def test_mscoco(self): | ||
|
||
# test basic usage | ||
dataset = MSCoCoDataset(data_root=self.data_root, pipeline=[]) | ||
assert dataset[0] == dict( | ||
gt_label="a good meal", | ||
img_path=os.path.join( | ||
self.data_root, | ||
'train2014/COCO_train2014_000000000009.jpg'), | ||
sample_idx=0) | ||
|
||
# test with different phase | ||
dataset = MSCoCoDataset( | ||
data_root=self.data_root, phase="val", pipeline=[]) | ||
assert dataset[0] == dict( | ||
gt_label="a pair of slippers", | ||
img_path=os.path.join( | ||
self.data_root, | ||
'val2014/COCO_val2014_000000000042.jpg'), | ||
sample_idx=0) |