(det_results, gt_bboxes, gt_labels, gt_ignore, class_id)
return cls_dets, cls_gts, cls_gt_ignore
Get det results and gt information of a certain class.
Get det results and gt information of a certain class.
Get det results and gt information of a certain class .
def get_cls_results(det_results, gt_bboxes, gt_labels, gt_ignore, class_id):
    """Get det results and gt information of a certain class."""
    cls_dets = [det[class_id]
                for det in det_results]  # det bboxes of this class
    cls_gts = []  # gt bboxes of this class
    cls_gt_ignore = []
    for j in range(len(gt_bboxes)):
        gt_bbox = gt_bboxes[j]
        cls_inds = (gt_labels[j] == class_id + 1)
        cls_gt = gt_bbox[cls_inds, :] if gt_bbox.shape[0] > 0 else gt_bbox
        cls_gts.append(cls_gt)
        if gt_ignore is None:
            cls_gt_ignore.append(np.zeros(cls_gt.shape[0], dtype=np.int32))
        else:
            cls_gt_ignore.append(gt_ignore[j][cls_inds])
    return cls_dets, cls_gts, cls_gt_ignore
def get_cls_results ( det_results , gt_bboxes , gt_labels , gt_ignore , class_id ) : cls_dets = [ det [ class_id ] for det in det_results ] # det bboxes of this class cls_gts = [ ] # gt bboxes of this class cls_gt_ignore = [ ] for j in range ( len ( gt_bboxes ) ) : gt_bbox = gt_bboxes [ j ] cls_inds = ( gt_labels [ j ] == class_id + 1 ) cls_gt = gt_bbox [ cls_inds , : ] if gt_bbox . shape [ 0 ] > 0 else gt_bbox cls_gts . append ( cls_gt ) if gt_ignore is None : cls_gt_ignore . append ( np . zeros ( cls_gt . shape [ 0 ] , dtype = np . int32 ) ) else : cls_gt_ignore . append ( gt_ignore [ j ] [ cls_inds ] ) return cls_dets , cls_gts , cls_gt_ignore