@classmethod
def build_evaluator(cls, cfg, dataset_name, output_folder=None):
    if (output_folder is None):
        output_folder = os.path.join(cfg.OUTPUT_DIR, 'inference')
    evaluator_list = []
    evaluator_type = MetadataCatalog.get(dataset_name).evaluator_type
    if (evaluator_type == 'lvis'):
        return LVISEvaluator(dataset_name, cfg, True, output_folder)
    if (evaluator_type == 'coco'):
        return COCOEvaluator(dataset_name, cfg, True, output_folder)
    if (evaluator_type == 'cityscapes'):
        assert (torch.cuda.device_count() >= comm.get_rank()), 'CityscapesEvaluator currently do not work with multiple machines.'
        return CityscapesInstanceEvaluator(dataset_name)
    if (len(evaluator_list) == 0):
        raise NotImplementedError(f'no Evaluator for the dataset {dataset_name} with the type {evaluator_type}')
    if (len(evaluator_list) == 1):
        return evaluator_list[0]
    return DatasetEvaluators(evaluator_list)
@classmethod
def build_evaluator(cls, cfg, dataset_name, output_folder=None):
    if (output_folder is None):
        output_folder = os.path.join(cfg.OUTPUT_DIR, 'inference')
    evaluator_list = []
    evaluator_type = MetadataCatalog.get(dataset_name).evaluator_type
    if (evaluator_type == 'lvis'):
        return LVISEvaluator(dataset_name, cfg, True, output_folder)
    if (evaluator_type == 'coco'):
        return COCOEvaluator(dataset_name, cfg, True, output_folder)
    if (evaluator_type == 'cityscapes'):
        assert (torch.cuda.device_count() >= comm.get_rank()), 'CityscapesEvaluator currently do not work with multiple machines.'
        return CityscapesInstanceEvaluator(dataset_name)
    if (len(evaluator_list) == 0):
        raise NotImplementedError(f'no Evaluator for the dataset {dataset_name} with the type {evaluator_type}')
    if (len(evaluator_list) == 1):
        return evaluator_list[0]
    return DatasetEvaluators(evaluator_list)