(bboxes, labels, obj_ids, num_classes)
Convert detection results to a list of numpy arrays.

    Args:
        bboxes (Tensor): shape (n, 5)
        labels (Tensor): shape (n, )
        obj_ids (Tensor): shape (n, )
        num_classes (int): class number, including background class

    Returns:
        list(ndarray): bbox results of each class
Convert detection results to a list of numpy arrays.
Convert detection results to a list of numpy arrays .
def bbox2result_with_id(bboxes, labels, obj_ids, num_classes):
    """Convert detection results to a list of numpy arrays.

    Args:
        bboxes (Tensor): shape (n, 5)
        labels (Tensor): shape (n, )
        obj_ids (Tensor): shape (n, )
        num_classes (int): class number, including background class

    Returns:
        list(ndarray): bbox results of each class
    """
    if bboxes.shape[0] == 0:
        return dict()
    else:
        bboxes = bboxes.cpu().numpy()
        labels = labels.cpu().numpy()
        results={}
        for bbox, label, obj_id in zip(bboxes, labels, obj_ids):
            if obj_id >= 0:
                results[obj_id] = {'bbox':bbox, 'label':label}
        return results
def bbox2result_with_id ( bboxes , labels , obj_ids , num_classes ) : if bboxes . shape [ 0 ] == 0 : return dict ( ) else : bboxes = bboxes . cpu ( ) . numpy ( ) labels = labels . cpu ( ) . numpy ( ) results = { } for bbox , label , obj_id in zip ( bboxes , labels , obj_ids ) : if obj_id >= 0 : results [ obj_id ] = { 'bbox' : bbox , 'label' : label } return results