def logits_process(logits):
    '\n    Get the logits as a tuple of softmax logits ,bounding boxes and labels.\n    Output: to matrices:\n    logits_mat in size (dataset, 300, 1231) - top 300 logits for each image.\n    bboxes_mat in size (dataset, 300, 4) - top 300 bboxes for each image.\n    labels_mat in size (dataset, 300, 1) - corresponding labels. 300 for each image.\n    '
    logits_mat = np.zeros((TEMP_DATASET_SIZE, 300, 1231))
    bboxes_mat = np.zeros((TEMP_DATASET_SIZE, 300, 4))
    labels_mat = np.zeros((TEMP_DATASET_SIZE, 300))
    proposal_num = np.zeros((TEMP_DATASET_SIZE, 300, 1))
    for (i, image) in enumerate(logits):
        for (j, bbox) in enumerate(image[0]):
            index = int(bbox[5].item())
            logits_vector = image[2][index]
            bboxes_mat[i][j][:] = bbox[:4]
            logits_mat[i][j] = np.array(logits_vector)
            proposal_num[i][j] = bbox[(- 1)]
        labels_mat[i] = image[1]
    return (bboxes_mat, labels_mat, logits_mat, proposal_num)
Get the logits as a tuple of softmax logits ,bounding boxes and labels.
Output: to matrices:
logits_mat in size (dataset, 300, 1231) - top 300 logits for each image.
bboxes_mat in size (dataset, 300, 4) - top 300 bboxes for each image.
labels_mat in size (dataset, 300, 1) - corresponding labels. 300 for each image.
def logits_process(logits):
    '\n    Get the logits as a tuple of softmax logits ,bounding boxes and labels.\n    Output: to matrices:\n    logits_mat in size (dataset, 300, 1231) - top 300 logits for each image.\n    bboxes_mat in size (dataset, 300, 4) - top 300 bboxes for each image.\n    labels_mat in size (dataset, 300, 1) - corresponding labels. 300 for each image.\n    '
    logits_mat = np.zeros((TEMP_DATASET_SIZE, 300, 1231))
    bboxes_mat = np.zeros((TEMP_DATASET_SIZE, 300, 4))
    labels_mat = np.zeros((TEMP_DATASET_SIZE, 300))
    proposal_num = np.zeros((TEMP_DATASET_SIZE, 300, 1))
    for (i, image) in enumerate(logits):
        for (j, bbox) in enumerate(image[0]):
            index = int(bbox[5].item())
            logits_vector = image[2][index]
            bboxes_mat[i][j][:] = bbox[:4]
            logits_mat[i][j] = np.array(logits_vector)
            proposal_num[i][j] = bbox[(- 1)]
        labels_mat[i] = image[1]
    return (bboxes_mat, labels_mat, logits_mat, proposal_num)