From c04a0e8f93c620d05444251e1ae55dcf8c660a1b Mon Sep 17 00:00:00 2001 From: giuros01 Date: Wed, 3 Oct 2018 12:44:35 +0100 Subject: COMPMID-1327: Add support for BBoxTransform operator in CL Change-Id: I91865506166951b3bf7f06a0b2d4cde925cfefb6 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/153447 Tested-by: bsgcomp Reviewed-by: Pablo Tello --- arm_compute/core/Types.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'arm_compute/core/Types.h') diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index 8a8cd509fa..5e04bcd0f4 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -851,6 +851,64 @@ private: unsigned int _sampling_ratio; }; +/** Bounding Box Transform information class */ +class BoundingBoxTransformInfo +{ +public: + /** Constructor + * + * @param[in] img_width Width of the original image + * @param[in] img_height Height, of the original image + * @param[in] scale Scale of the original image + * @param[in] apply_scale (Optional)Re-apply scaling after transforming the boxes. Defaults to false + * @param[in] weights (Optional)Weights [wx, wy, ww, wh] for the deltas. Defaults to all ones + * @param[in] bbox_xform_clip (Optional)Minimum bounding box width and height after bounding box transformation in log-space. Defaults to log(1000/16) + */ + BoundingBoxTransformInfo(float img_width, float img_height, float scale, bool apply_scale = false, const std::array weights = { 1.0, 1.0, 1.0, 1.0 }, float bbox_xform_clip = + 4.135166556742356) + : _img_width(img_width), _img_height(img_height), _scale(scale), _apply_scale(apply_scale), _weights(weights), _bbox_xform_clip(bbox_xform_clip) + { + } + + std::array weights() const + { + return _weights; + } + + float bbox_xform_clip() const + { + return _bbox_xform_clip; + } + + float img_height() const + { + return _img_height; + } + + float img_width() const + { + return _img_width; + } + + float scale() const + { + return _scale; + } + + bool apply_scale() const + { + return _apply_scale; + } + +private: + float _img_width; + float _img_height; + float _scale; + bool _apply_scale; + std::array _weights; + float _bbox_xform_clip; +}; + /** Activation Layer Information class */ class ActivationLayerInfo { -- cgit v1.2.1