From d985378af0c9a4db6a483634dd40526cd4031dee Mon Sep 17 00:00:00 2001 From: Giuseppe Rossini Date: Fri, 25 Oct 2019 11:11:44 +0100 Subject: COMPMID-2588: Optimize the output detection kernel required by MobileNet-SSD (~27% improvement) Change-Id: Ic6ce570af3878a0666ec680e0efabba3fcfd1222 Signed-off-by: Giuseppe Rossini Reviewed-on: https://review.mlplatform.org/c/2160 Comments-Addressed: Arm Jenkins Reviewed-by: Georgios Pinitas Reviewed-by: Gian Marco Iodice Tested-by: Arm Jenkins --- arm_compute/core/Types.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'arm_compute/core/Types.h') diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index d7b47ac512..0a25277b57 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -1099,7 +1099,8 @@ public: _num_classes(), _scales_values(), _use_regular_nms(), - _detection_per_class() + _detection_per_class(), + _dequantize_scores() { } /** Constructor @@ -1110,11 +1111,12 @@ public: * @param[in] iou_threshold Threshold to be used during the intersection over union. * @param[in] num_classes Number of classes. * @param[in] scales_values Scales values used for decode center size boxes. - * @param[in] use_regular_nms (Optional) Boolean to determinate if use regular or fast nms. - * @param[in] detection_per_class (Optional) Number of detection per class. Used in the Regular Non-Max-Suppression + * @param[in] use_regular_nms (Optional) Boolean to determinate if use regular or fast nms. Defaults to false. + * @param[in] detection_per_class (Optional) Number of detection per class. Used in the Regular Non-Max-Suppression. Defaults to 100. + * @param[in] dequantize_scores (Optional) If the scores need to be dequantized. Defaults to true. */ DetectionPostProcessLayerInfo(unsigned int max_detections, unsigned int max_classes_per_detection, float nms_score_threshold, float iou_threshold, unsigned int num_classes, - std::array scales_values, bool use_regular_nms = false, unsigned int detection_per_class = 100) + std::array scales_values, bool use_regular_nms = false, unsigned int detection_per_class = 100, bool dequantize_scores = true) : _max_detections(max_detections), _max_classes_per_detection(max_classes_per_detection), _nms_score_threshold(nms_score_threshold), @@ -1122,7 +1124,8 @@ public: _num_classes(num_classes), _scales_values(scales_values), _use_regular_nms(use_regular_nms), - _detection_per_class(detection_per_class) + _detection_per_class(detection_per_class), + _dequantize_scores(dequantize_scores) { } /** Get max detections. */ @@ -1184,6 +1187,11 @@ public: // Saved as [y,x,h,w] return _scales_values[3]; } + /** Get dequantize_scores value. */ + bool dequantize_scores() const + { + return _dequantize_scores; + } private: unsigned int _max_detections; @@ -1194,6 +1202,7 @@ private: std::array _scales_values; bool _use_regular_nms; unsigned int _detection_per_class; + bool _dequantize_scores; }; /** Pooling Layer Information class */ -- cgit v1.2.1