def build_evaluator_list(base_ds, dataset_name):
    'Helper function to build the list of evaluators for a given dataset'
    evaluator_list = []
    if args.no_detection:
        return evaluator_list
    iou_types = ['bbox']
    if args.masks:
        iou_types.append('segm')
    evaluator_list.append(CocoEvaluator(base_ds, tuple(iou_types), useCats=False))
    if ('refexp' in dataset_name):
        evaluator_list.append(RefExpEvaluator(base_ds, 'bbox'))
    if ('clevrref' in dataset_name):
        evaluator_list.append(ClevrRefEvaluator(base_ds, 'bbox'))
    if ('flickr' in dataset_name):
        evaluator_list.append(FlickrEvaluator(args.flickr_dataset_path, subset=('test' if args.test else 'val'), merge_boxes=(args.GT_type == 'merged')))
    if ('phrasecut' in dataset_name):
        evaluator_list.append(PhrasecutEvaluator(('test' if args.test else 'miniv'), ann_folder=args.phrasecut_orig_ann_path, output_dir=os.path.join(output_dir, 'phrasecut_eval'), eval_mask=args.masks))
    return evaluator_list
Helper function to build the list of evaluators for a given dataset
def build_evaluator_list(base_ds, dataset_name):
    
    evaluator_list = []
    if args.no_detection:
        return evaluator_list
    iou_types = ['bbox']
    if args.masks:
        iou_types.append('segm')
    evaluator_list.append(CocoEvaluator(base_ds, tuple(iou_types), useCats=False))
    if ('refexp' in dataset_name):
        evaluator_list.append(RefExpEvaluator(base_ds, 'bbox'))
    if ('clevrref' in dataset_name):
        evaluator_list.append(ClevrRefEvaluator(base_ds, 'bbox'))
    if ('flickr' in dataset_name):
        evaluator_list.append(FlickrEvaluator(args.flickr_dataset_path, subset=('test' if args.test else 'val'), merge_boxes=(args.GT_type == 'merged')))
    if ('phrasecut' in dataset_name):
        evaluator_list.append(PhrasecutEvaluator(('test' if args.test else 'miniv'), ann_folder=args.phrasecut_orig_ann_path, output_dir=os.path.join(output_dir, 'phrasecut_eval'), eval_mask=args.masks))
    return evaluator_list