cvtools.evaluation package¶
Submodules¶
Module contents¶
-
cvtools.evaluation.
fast_eval_recall
(results, coco, max_dets, iou_thrs=array([0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95]))[源代码]¶
-
cvtools.evaluation.
average_precision
(recalls, precisions, mode='area')[源代码]¶ Calculate average precision (for single or multiple scales).
参数: - recalls (ndarray) -- shape (num_scales, num_dets) or (num_dets, )
- precisions (ndarray) -- shape (num_scales, num_dets) or (num_dets, )
- mode (str) -- 'area' or '11points', 'area' means calculating the area under precision-recall curve, '11points' means calculating the average precision of recalls at [0, 0.1, ..., 1]
返回: calculated average precision
返回类型: float or ndarray
-
cvtools.evaluation.
eval_map
(det_results, gt_bboxes, gt_labels, gt_ignore=None, scale_ranges=None, iou_thr=0.5, dataset=None, print_summary=True, calc_ious=<function bbox_overlaps>)[源代码]¶ Evaluate mAP of a dataset.
参数: - det_results (list) -- a list of list, [[cls1_det, cls2_det, ...], ...] cls1_det为np.array,包含K*5,包含得分, x1y1x2y2形式
- gt_bboxes (list) -- ground truth bboxes of each image, a list of K*4 array. x1y1x2y2形式
- gt_labels (list) -- ground truth labels of each image, a list of K array
- gt_ignore (list) -- gt ignore indicators of each image, a list of K array
- scale_ranges (list, optional) -- [(min1, max1), (min2, max2), ...]
- iou_thr (float) -- IoU threshold,目前还不支持polyiou
- dataset (None or str or list) -- dataset name or dataset classes, there are minor differences in metrics for different datsets, e.g. "voc07", "imagenet_det", etc.
- print_summary (bool) -- whether to print the mAP summary
返回: (mAP, [dict, dict, ...])
返回类型: tuple
-
cvtools.evaluation.
print_map_summary
(mean_ap, results, dataset=None)[源代码]¶ Print mAP and results of each class.
参数: - mean_ap (float) -- calculated from eval_map
- results (list) -- calculated from eval_map
- dataset (None or str or list) -- dataset name or dataset classes.
-
cvtools.evaluation.
eval_recalls
(gts, proposals, proposal_nums=None, iou_thrs=None, print_summary=True)[源代码]¶ Calculate recalls.
参数: - gts (list or ndarray) -- a list of arrays of shape (n, 4)
- proposals (list or ndarray) -- a list of arrays of shape (k, 4) or (k, 5)
- proposal_nums (int or list of int or ndarray) -- top N proposals
- thrs (float or list or ndarray) -- iou thresholds
返回: recalls of different ious and proposal nums
返回类型: ndarray
-
cvtools.evaluation.
print_recall_summary
(recalls, proposal_nums, iou_thrs, row_idxs=None, col_idxs=None)[源代码]¶ Print recalls in a table.
参数: - recalls (ndarray) -- calculated from bbox_recalls
- proposal_nums (ndarray or list) -- top N proposals
- iou_thrs (ndarray or list) -- iou thresholds
- row_idxs (ndarray) -- which rows(proposal nums) to print
- col_idxs (ndarray) -- which cols(iou thresholds) to print
-
cvtools.evaluation.
plot_num_recall
(recalls, proposal_nums)[源代码]¶ Plot Proposal_num-Recalls curve.
参数: - recalls (ndarray or list) -- shape (k,)
- proposal_nums (ndarray or list) -- same shape as recalls
-
cvtools.evaluation.
plot_iou_recall
(recalls, iou_thrs)[源代码]¶ Plot IoU-Recalls curve.
参数: - recalls (ndarray or list) -- shape (k,)
- iou_thrs (ndarray or list) -- same shape as recalls
-
class
cvtools.evaluation.
MergeCropDetResults
(gts, results, num_coors=4)[源代码]¶ 基类:
object