def single_gpu_test(model, data_loader, show=False, cfg=None, index=0, img_meta=None):
    model.eval()
    results = []
    logits_list = []
    dataset = data_loader.dataset
    prog_bar = mmcv.ProgressBar(len(dataset))
    class_instances = pickle.load(open('train_instances_list.p', 'rb'))
    normalized_classes = np.zeros(1231)
    for (i, c) in enumerate(class_instances):
        if c:
            normalized_classes[i] = (1 / np.sqrt(c))
    for (i, data) in enumerate(data_loader):
        if (i >= (TEMP_DATASET_SIZE * (index + 1))):
            break
        with torch.no_grad():
            (bbox_results, det_bboxes, det_labels, scores) = model(return_loss=False, rescale=(not show), **data, img_id=i, norm_cls=normalized_classes)
            det_bboxes = det_bboxes.detach().cpu()
            det_labels = det_labels.detach().cpu()
            scores = scores.detach().cpu()
        results.append(bbox_results)
        logits_list.append((det_bboxes, det_labels, scores))
        if show:
            model.module.show_result(data, bbox_results)
        batch_size = data['img'][0].size(0)
        for _ in range(batch_size):
            prog_bar.update()
    return (results, logits_list)
def single_gpu_test(model, data_loader, show=False, cfg=None, index=0, img_meta=None):
    model.eval()
    results = []
    logits_list = []
    dataset = data_loader.dataset
    prog_bar = mmcv.ProgressBar(len(dataset))
    class_instances = pickle.load(open('train_instances_list.p', 'rb'))
    normalized_classes = np.zeros(1231)
    for (i, c) in enumerate(class_instances):
        if c:
            normalized_classes[i] = (1 / np.sqrt(c))
    for (i, data) in enumerate(data_loader):
        if (i >= (TEMP_DATASET_SIZE * (index + 1))):
            break
        with torch.no_grad():
            (bbox_results, det_bboxes, det_labels, scores) = model(return_loss=False, rescale=(not show), **data, img_id=i, norm_cls=normalized_classes)
            det_bboxes = det_bboxes.detach().cpu()
            det_labels = det_labels.detach().cpu()
            scores = scores.detach().cpu()
        results.append(bbox_results)
        logits_list.append((det_bboxes, det_labels, scores))
        if show:
            model.module.show_result(data, bbox_results)
        batch_size = data['img'][0].size(0)
        for _ in range(batch_size):
            prog_bar.update()
    return (results, logits_list)