Commit ec3df466 authored by Ilija Radosavovic's avatar Ilija Radosavovic Committed by Facebook Github Bot

Deprecate the TEST.NUM_TEST_IMAGES option for consistency

Reviewed By: rbgirshick

Differential Revision: D6829095

fbshipit-source-id: 1d36fd7adf1596350017c437a4365d360a21dccd
parent aee97b14
......@@ -270,11 +270,6 @@ __C.TEST.COMPETITION_MODE = True
# COCO API to get COCO style AP on PASCAL VOC)
__C.TEST.FORCE_JSON_DATASET_EVAL = False
# Number of images to test on - presently used in RetinaNet Inference only
# If the dataset name include 'test-dev' or 'test', this is ignored (i.e.,
# it's intended to apply to a validation set)
__C.TEST.NUM_TEST_IMAGES = 5000
# [Inferred value; do not set directly in a config]
# Indicates if precomputed proposals are used at test time
# Not set for 1-stage models and 2-stage models with RPN subnetwork enabled
......@@ -981,6 +976,7 @@ _DEPCRECATED_KEYS = set(
'TRAIN.BBOX_NORMALIZE_TARGETS_PRECOMPUTED',
'TRAIN.DROPOUT',
'USE_GPU_NMS',
'TEST.NUM_TEST_IMAGES',
)
)
......
......@@ -229,12 +229,6 @@ def test_retinanet(ind_range=None):
if ind_range is not None:
start, end = ind_range
roidb = roidb[start:end]
logger.info('Testing on roidb range: {}-{}'.format(start, end))
else:
# if testing over the whole dataset, use the NUM_TEST_IMAGES setting
# the NUM_TEST_IMAGES could be over a small set of images for quick
# debugging purposes
roidb = roidb[0:cfg.TEST.NUM_TEST_IMAGES]
# Create and load the model
model = model_builder.create(cfg.MODEL.TYPE, train=False)
if cfg.TEST.WEIGHTS:
......@@ -259,7 +253,7 @@ def test_retinanet(ind_range=None):
return all_boxes
def multi_gpu_test_retinanet_on_dataset(num_images, output_dir, dataset):
def multi_gpu_test_retinanet_on_dataset(num_images, output_dir):
"""
If doing multi-gpu testing, we need to divide the data on various gpus and
make the subprocess call for each child process that'll run test_retinanet()
......@@ -303,16 +297,9 @@ def test_retinanet_on_dataset(multi_gpu=False):
dataset = JsonDataset(cfg.TEST.DATASET)
test_timer = Timer()
test_timer.tic()
# for test-dev or full test dataset, we generate detections for all images
if 'test-dev' in cfg.TEST.DATASET or 'test' in cfg.TEST.DATASET:
cfg.TEST.NUM_TEST_IMAGES = len(dataset.get_roidb())
if multi_gpu:
num_images = cfg.TEST.NUM_TEST_IMAGES
all_boxes = multi_gpu_test_retinanet_on_dataset(
num_images, output_dir, dataset
)
num_images = len(dataset.get_roidb())
all_boxes = multi_gpu_test_retinanet_on_dataset(num_images, output_dir)
else:
all_boxes = test_retinanet()
test_timer.toc()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment