pipert.contrib.detection_demo.utils¶
Module Contents¶
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Compute the average precision, given the recall and precision curves. |
|
Compute the average precision, given the recall and precision curves. |
|
|
|
|
|
|
|
|
|
Removes detections with lower object confidence score than ‘conf_thres’ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
pipert.contrib.detection_demo.utils.labels_to_image_weights(labels, nc=80, class_weights=np.ones(80))[source]¶
-
pipert.contrib.detection_demo.utils.ap_per_class(tp, conf, pred_cls, target_cls)[source]¶ Compute the average precision, given the recall and precision curves. Source: https://github.com/rafaelpadilla/Object-Detection-Metrics. # Arguments
tp: True positives (list). conf: Objectness value from 0-1 (list). pred_cls: Predicted object classes (list). target_cls: True object classes (list).
- # Returns
The average precision as computed in py-faster-rcnn.
-
pipert.contrib.detection_demo.utils.compute_ap(recall, precision)[source]¶ Compute the average precision, given the recall and precision curves. Source: https://github.com/rbgirshick/py-faster-rcnn. # Arguments
recall: The recall curve (list). precision: The precision curve (list).
- # Returns
The average precision as computed in py-faster-rcnn.
-
class
pipert.contrib.detection_demo.utils.FocalLoss(loss_fcn, gamma=0.5, alpha=1, reduction='mean')[source]¶ Bases:
torch.nn.Module
-
pipert.contrib.detection_demo.utils.non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.5)[source]¶ Removes detections with lower object confidence score than ‘conf_thres’ Non-Maximum Suppression to further filter detections. Returns detections with shape:
(x1, y1, x2, y2, object_conf, class_conf, class)
-
pipert.contrib.detection_demo.utils.coco_single_class_labels(path='../coco/labels/train2014/', label_class=43)[source]¶
-
pipert.contrib.detection_demo.utils.plot_one_box(x, img, color=None, label=None, line_thickness=None)[source]¶