Skip to content

Commit

Permalink
add the test2017 set
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyingming committed Apr 11, 2022
1 parent f3fdc7c commit 1bd1ce5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion datasets/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def make_coco_transforms(image_set):
normalize,
])

if image_set == 'val':
if image_set == 'val' or image_set == 'test':
return T.Compose([
T.RandomResize([800], max_size=1333),
normalize,
Expand All @@ -161,6 +161,7 @@ def build(image_set, args):
PATHS = {
"train": (root / "train2017", root / "annotations" / f'{mode}_train2017.json'),
"val": (root / "val2017", root / "annotations" / f'{mode}_val2017.json'),
"test": (root / "test2017", root / "annotations" / 'image_info_test-dev2017.json'),
}

img_folder, ann_file = PATHS[image_set]
Expand Down
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def get_args_parser():

# dataset parameters
parser.add_argument('--dataset_file', default='coco')
parser.add_argument('--eval_set', default='val', choices=['val', 'test'],
type=str,help="dataset to evaluate")
parser.add_argument('--coco_path', default='/data/coco', type=str)
parser.add_argument('--coco_panoptic_path', type=str)
parser.add_argument('--remove_difficult', action='store_true')
Expand Down Expand Up @@ -154,7 +156,7 @@ def main(args):
print('number of params:', n_parameters)

dataset_train = build_dataset(image_set='train', args=args)
dataset_val = build_dataset(image_set='val', args=args)
dataset_val = build_dataset(image_set=args.eval_set, args=args)

if args.distributed:
if args.cache_mode:
Expand Down

0 comments on commit 1bd1ce5

Please sign in to comment.