A class to post process model predictions.
More...
#include <opencv2/core_detect.hpp>
|
| InferBbox (Mat _delta_bbox, Mat _class_scores, Mat _conf_scores) |
| Default constructer.
|
|
void | filter (double thresh=0.8) |
| Filters the bounding boxes.
|
|
|
std::vector< object > | detections |
| Vector which holds the final detections of the model.
|
|
|
void | assert_predictions (std::vector< std::vector< double > > *min_max_boxes) |
| Ensures that the bounding box values are within image boundaries.
|
|
void | filter_top_n (std::vector< std::vector< double > > *probs, std::vector< std::vector< double > > *boxes, std::vector< std::vector< double > > &top_n_boxes, std::vector< size_t > &top_n_idxs, std::vector< double > &top_n_probs) |
| Filter top n predictions.
|
|
void | final_probability_dist (std::vector< std::vector< double > > *final_probs) |
| Computes final probability values of each bounding box.
|
|
void | intersection_over_union (std::vector< std::vector< double > > *boxes, std::vector< double > *base_box, std::vector< double > *iou) |
| Computes intersection over union of bounding boxes.
|
|
void | nms_wrapper (std::vector< std::vector< double > > &top_n_boxes, std::vector< size_t > &top_n_idxs, std::vector< double > &top_n_probs) |
| Wrapper to apply Non-Maximal Supression.
|
|
std::vector< bool > | non_maximal_suppression (std::vector< std::vector< double > > *boxes, std::vector< double > *probs) |
| Applies Non-Maximal Supression.
|
|
void | transform_bboxes (std::vector< std::vector< double > > *bboxes) |
| Transform relative coordinates from ConvDet to bounding box coordinates.
|
|
void | transform_bboxes_inv (std::vector< std::vector< double > > *pre, std::vector< std::vector< double > > *post) |
| Transform bounding boxes from [x, y, h, w] to [xmin, ymin, xmax, ymax].
|
|
|
static bool | comparator (std::pair< double, size_t > l1, std::pair< double, size_t > l2) |
|
A class to post process model predictions.
cv::dnn_objdetect::InferBbox::InferBbox |
( |
Mat |
_delta_bbox, |
|
|
Mat |
_class_scores, |
|
|
Mat |
_conf_scores |
|
) |
| |
Default constructer.
- Parameters
-
_delta_bbox | Blob containing relative coordinates of bounding boxes |
_class_scores | Blob containing the probability values of each class |
_conf_scores | Blob containing the confidence scores |
void cv::dnn_objdetect::InferBbox::assert_predictions |
( |
std::vector< std::vector< double > > * |
min_max_boxes | ) |
|
|
protected |
Ensures that the bounding box values are within image boundaries.
- Parameters
-
min_max_boxes | Vector containing bounding boxes of the form [xmin, ymin, xmax, ymax] |
static bool cv::dnn_objdetect::InferBbox::comparator |
( |
std::pair< double, size_t > |
l1, |
|
|
std::pair< double, size_t > |
l2 |
|
) |
| |
|
inlinestaticprotected |
void cv::dnn_objdetect::InferBbox::filter |
( |
double |
thresh = 0.8 | ) |
|
Filters the bounding boxes.
void cv::dnn_objdetect::InferBbox::filter_top_n |
( |
std::vector< std::vector< double > > * |
probs, |
|
|
std::vector< std::vector< double > > * |
boxes, |
|
|
std::vector< std::vector< double > > & |
top_n_boxes, |
|
|
std::vector< size_t > & |
top_n_idxs, |
|
|
std::vector< double > & |
top_n_probs |
|
) |
| |
|
protected |
Filter top n
predictions.
- Parameters
-
probs | Final probability values of bounding boxes |
boxes | Predicted bounding box co-ordinates |
top_n_boxes | Contains bounding box co-ordinates of top n boxes |
top_n_idxs | Containes class indices of top n bounding boxes |
top_n_probs | Contains probability values of top n bounding boxes |
void cv::dnn_objdetect::InferBbox::final_probability_dist |
( |
std::vector< std::vector< double > > * |
final_probs | ) |
|
|
protected |
Computes final probability values of each bounding box.
- Parameters
-
final_probs | Vector to hold the probability values |
void cv::dnn_objdetect::InferBbox::intersection_over_union |
( |
std::vector< std::vector< double > > * |
boxes, |
|
|
std::vector< double > * |
base_box, |
|
|
std::vector< double > * |
iou |
|
) |
| |
|
protected |
Computes intersection over union of bounding boxes.
- Parameters
-
boxes | Vector of bounding box co-ordinates |
base_box | Base box wrt which IOU is calculated |
iou | Vector to store IOU values |
void cv::dnn_objdetect::InferBbox::nms_wrapper |
( |
std::vector< std::vector< double > > & |
top_n_boxes, |
|
|
std::vector< size_t > & |
top_n_idxs, |
|
|
std::vector< double > & |
top_n_probs |
|
) |
| |
|
protected |
Wrapper to apply Non-Maximal Supression.
- Parameters
-
top_n_boxes | Contains bounding box co-ordinates of top n boxes |
top_n_idxs | Containes class indices of top n bounding boxes |
top_n_probs | Contains probability values of top n bounding boxes |
std::vector<bool> cv::dnn_objdetect::InferBbox::non_maximal_suppression |
( |
std::vector< std::vector< double > > * |
boxes, |
|
|
std::vector< double > * |
probs |
|
) |
| |
|
protected |
Applies Non-Maximal Supression.
- Parameters
-
boxes | Bounding box co-ordinates belonging to one class |
probs | Probability values of boxes belonging to one class |
void cv::dnn_objdetect::InferBbox::transform_bboxes |
( |
std::vector< std::vector< double > > * |
bboxes | ) |
|
|
protected |
Transform relative coordinates from ConvDet to bounding box coordinates.
- Parameters
-
bboxes | Vector to hold the predicted bounding boxes |
void cv::dnn_objdetect::InferBbox::transform_bboxes_inv |
( |
std::vector< std::vector< double > > * |
pre, |
|
|
std::vector< std::vector< double > > * |
post |
|
) |
| |
|
protected |
Transform bounding boxes from [x, y, h, w] to [xmin, ymin, xmax, ymax].
- Parameters
-
pre | Vector conatining initial co-ordinates |
post | Vector containing the transformed co-ordinates |
std::vector<object> cv::dnn_objdetect::InferBbox::detections |
Vector which holds the final detections of the model.
The documentation for this class was generated from the following file: