Skip to content

Commit

Permalink
add benchmark set, reorder parameter of custom dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
yhcao6 committed Dec 21, 2018
1 parent f0ecb9d commit dc5edc3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions configs/pascal_voc/ssd300_voc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
benchmark = True
# model settings
input_size = 300
model = dict(
Expand Down
1 change: 1 addition & 0 deletions configs/pascal_voc/ssd512_voc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
benchmark = True
# model settings
input_size = 512
model = dict(
Expand Down
1 change: 1 addition & 0 deletions configs/ssd300_coco.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
benchmark = True
# model settings
input_size = 300
model = dict(
Expand Down
1 change: 1 addition & 0 deletions configs/ssd512_coco.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
benchmark = True
# model settings
input_size = 512
model = dict(
Expand Down
4 changes: 2 additions & 2 deletions mmdet/datasets/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def __init__(self,
with_mask=True,
with_crowd=True,
with_label=True,
test_mode=False,
extra_aug=None,
resize_keep_ratio=True):
resize_keep_ratio=True,
test_mode=False):
# prefix of images path
self.img_prefix = img_prefix

Expand Down
4 changes: 4 additions & 0 deletions tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from mmdet.apis import (train_detector, init_dist, get_root_logger,
set_random_seed)
from mmdet.models import build_detector
import torch


def parse_args():
Expand Down Expand Up @@ -42,6 +43,9 @@ def main():
args = parse_args()

cfg = Config.fromfile(args.config)
# set benchmark
if cfg.get('benchmark', False):
torch.backends.cudnn.benchmark = True
# update configs according to CLI args
if args.work_dir is not None:
cfg.work_dir = args.work_dir
Expand Down

0 comments on commit dc5edc3

Please sign in to comment.