24 #ifndef ARM_COMPUTE_TYPES_H 25 #define ARM_COMPUTE_TYPES_H 214 : anchor{ an_anchor },
shape{ a_shape }
216 anchor.set_num_dimensions(std::max(anchor.num_dimensions(),
shape.num_dimensions()));
227 : anchor{ an_anchor },
shape{ a_shape }
230 anchor.set_num_dimensions(num_dimensions);
240 int end(
unsigned int d)
const 242 return anchor[d] +
shape[d];
255 anchor.
set(dimension, start);
256 shape.set(dimension, size);
277 : top{ 0 }, right{ 0 }, bottom{ 0 }, left{ 0 }
283 : top{ size }, right{ size }, bottom{ size }, left{ size }
288 constexpr
BorderSize(
unsigned int top_bottom,
unsigned int left_right)
289 : top{ top_bottom }, right{ left_right }, bottom{ top_bottom }, left{ left_right }
294 constexpr
BorderSize(
unsigned int top,
unsigned int right,
unsigned int bottom,
unsigned int left)
295 : top{ top }, right{ right }, bottom{ bottom }, left{ left }
302 return top == 0 && right == 0 && bottom == 0 && left == 0;
308 return top == right && top == bottom && top == left;
349 return (top == rhs.
top) && (right == rhs.
right) && (bottom == rhs.
bottom) && (left == rhs.
left);
360 return !(*
this == rhs);
369 top = std::min(top, limit.
top);
370 right = std::min(right, limit.
right);
371 bottom = std::min(bottom, limit.
bottom);
372 left = std::min(left, limit.
left);
443 float strength{ 0.f };
445 float orientation{ 0.f };
446 int32_t tracking_status{ 0 };
595 uint16_t height{ 0 };
596 uint16_t idx_class{ 0 };
644 int detections = 100,
bool soft_nms_enabled =
false,
646 float soft_nms_sigma = 0.5f,
float soft_nms_min_score_thres = 0.001f,
bool suppress_size =
false,
float min_size = 1.0f,
float im_width = 1.0f,
float im_height = 1.0f)
647 : _score_thresh(score_thresh), _nms(nms), _detections_per_im(detections), _soft_nms_enabled(soft_nms_enabled), _soft_nms_method(soft_nms_method), _soft_nms_sigma(soft_nms_sigma),
648 _soft_nms_min_score_thres(soft_nms_min_score_thres), _suppress_size(suppress_size), _min_size(min_size), _im_width(im_width), _im_height(im_height)
654 return _score_thresh;
664 return _detections_per_im;
669 return _soft_nms_enabled;
674 return _soft_nms_method;
679 return _soft_nms_sigma;
684 return _soft_nms_min_score_thres;
689 return _suppress_size;
710 int _detections_per_im;
711 bool _soft_nms_enabled;
713 float _soft_nms_sigma;
714 float _soft_nms_min_score_thres;
734 unsigned int pad_x = 0,
unsigned int pad_y = 0,
736 : _stride(
std::make_pair(stride_x, stride_y)),
755 unsigned int pad_left,
unsigned int pad_right,
756 unsigned int pad_top,
unsigned int pad_bottom,
758 : _stride(
std::make_pair(stride_x, stride_y)),
761 _pad_right(pad_right),
762 _pad_bottom(pad_bottom),
770 std::pair<unsigned int, unsigned int>
stride()
const 780 return (_pad_left == _pad_right) && (_pad_top == _pad_bottom);
788 std::pair<unsigned int, unsigned int>
pad()
const 792 return std::make_pair(_pad_left, _pad_top);
825 return (_pad_left != 0 || _pad_top != 0 || _pad_right != 0 || _pad_bottom != 0);
829 std::pair<unsigned int, unsigned int> _stride;
830 unsigned int _pad_left;
831 unsigned int _pad_top;
832 unsigned int _pad_right;
833 unsigned int _pad_bottom;
867 PriorBoxLayerInfo(
const std::vector<float> &min_sizes,
const std::vector<float> &variances,
float offset,
bool flip =
true,
bool clip =
false,
868 const std::vector<float> &max_sizes = {},
const std::vector<float> &aspect_ratios = {},
870 : _min_sizes(min_sizes),
871 _variances(variances),
875 _max_sizes(max_sizes),
880 _aspect_ratios.push_back(1.);
881 for(
unsigned int i = 0; i < aspect_ratios.size(); ++i)
883 float ar = aspect_ratios[i];
884 bool already_exist =
false;
885 for(
auto ar_new : _aspect_ratios)
887 if(fabs(ar - ar_new) < 1e-6)
889 already_exist =
true;
895 _aspect_ratios.push_back(ar);
898 _aspect_ratios.push_back(1.f / ar);
946 return _aspect_ratios;
950 std::vector<float> _min_sizes;
951 std::vector<float> _variances;
955 std::vector<float> _max_sizes;
956 std::vector<float> _aspect_ratios;
958 std::array<float, 2> _steps;
962 using BBox = std::array<float, 4>;
987 _background_label_id(),
988 _confidence_threshold(),
989 _variance_encoded_in_target(false),
993 _num_loc_classes = _share_location ? 1 : _num_classes;
1010 : _num_classes(num_classes),
1011 _share_location(share_location),
1012 _code_type(code_type),
1013 _keep_top_k(keep_top_k),
1014 _nms_threshold(nms_threshold),
1016 _background_label_id(background_label_id),
1017 _confidence_threshold(confidence_threshold),
1018 _variance_encoded_in_target(variance_encoded_in_target),
1022 _num_loc_classes = _share_location ? 1 : _num_classes;
1027 return _num_classes;
1032 return _share_location;
1042 return _variance_encoded_in_target;
1052 return _nms_threshold;
1062 return _background_label_id;
1067 return _confidence_threshold;
1077 return _num_loc_classes;
1082 bool _share_location;
1085 float _nms_threshold;
1087 int _background_label_id;
1088 float _confidence_threshold;
1089 bool _variance_encoded_in_target;
1091 int _num_loc_classes;
1100 : _max_detections(),
1101 _max_classes_per_detection(),
1102 _nms_score_threshold(),
1107 _detection_per_class(),
1108 _dequantize_scores()
1123 DetectionPostProcessLayerInfo(
unsigned int max_detections,
unsigned int max_classes_per_detection,
float nms_score_threshold,
float iou_threshold,
unsigned int num_classes,
1124 std::array<float, 4> scales_values,
bool use_regular_nms =
false,
unsigned int detection_per_class = 100,
bool dequantize_scores =
true)
1125 : _max_detections(max_detections),
1126 _max_classes_per_detection(max_classes_per_detection),
1127 _nms_score_threshold(nms_score_threshold),
1128 _iou_threshold(iou_threshold),
1129 _num_classes(num_classes),
1130 _scales_values(scales_values),
1131 _use_regular_nms(use_regular_nms),
1132 _detection_per_class(detection_per_class),
1133 _dequantize_scores(dequantize_scores)
1139 return _max_detections;
1144 return _max_classes_per_detection;
1149 return _detection_per_class;
1154 return _nms_score_threshold;
1159 return _iou_threshold;
1164 return _num_classes;
1169 return _use_regular_nms;
1175 return _scales_values[0];
1181 return _scales_values[1];
1187 return _scales_values[2];
1193 return _scales_values[3];
1198 return _dequantize_scores;
1202 unsigned int _max_detections;
1203 unsigned int _max_classes_per_detection;
1204 float _nms_score_threshold;
1205 float _iou_threshold;
1206 unsigned int _num_classes;
1207 std::array<float, 4> _scales_values;
1208 bool _use_regular_nms;
1209 unsigned int _detection_per_class;
1210 bool _dequantize_scores;
1222 exclude_padding(false),
1223 is_global_pooling(false),
1224 fp_mixed_precision(false)
1242 bool exclude_padding =
false,
1243 bool fp_mixed_precision =
false)
1244 : pool_type(pool_type),
1245 pool_size(
Size2D(pool_size, pool_size)),
1246 data_layout(data_layout),
1247 pad_stride_info(pad_stride_info),
1248 exclude_padding(exclude_padding),
1249 is_global_pooling(false),
1250 fp_mixed_precision(fp_mixed_precision)
1269 bool exclude_padding =
false,
1270 bool fp_mixed_precision =
false)
1271 : pool_type(pool_type),
1272 pool_size(pool_size),
1273 data_layout(data_layout),
1274 pad_stride_info(pad_stride_info),
1275 exclude_padding(exclude_padding),
1276 is_global_pooling(false),
1277 fp_mixed_precision(fp_mixed_precision)
1289 : pool_type(pool_type),
1291 data_layout(data_layout),
1293 exclude_padding(false),
1294 is_global_pooling(true),
1295 fp_mixed_precision(false)
1319 ROIPoolingLayerInfo(
unsigned int pooled_width,
unsigned int pooled_height,
float spatial_scale,
unsigned int sampling_ratio = 0)
1320 : _pooled_width(pooled_width), _pooled_height(pooled_height), _spatial_scale(spatial_scale), _sampling_ratio(sampling_ratio)
1326 return _pooled_width;
1331 return _pooled_height;
1336 return _spatial_scale;
1341 return _sampling_ratio;
1345 unsigned int _pooled_width;
1346 unsigned int _pooled_height;
1347 float _spatial_scale;
1348 unsigned int _sampling_ratio;
1367 GenerateProposalsInfo(
float im_width,
float im_height,
float im_scale,
float spatial_scale = 1.0,
int pre_nms_topN = 6000,
int post_nms_topN = 300,
float nms_thres = 0.7,
float min_size = 16.0,
1368 size_t values_per_roi = 4)
1369 : _im_height(im_height), _im_width(im_width), _im_scale(im_scale), _spatial_scale(spatial_scale), _pre_nms_topN(pre_nms_topN), _post_nms_topN(post_nms_topN), _nms_thres(nms_thres),
1370 _min_size(min_size), _values_per_roi(values_per_roi)
1392 return _pre_nms_topN;
1397 return _post_nms_topN;
1412 return _spatial_scale;
1417 return _values_per_roi;
1424 float _spatial_scale;
1429 size_t _values_per_roi;
1444 : _feat_height(feat_height),
1445 _feat_width(feat_width),
1446 _spatial_scale(spatial_scale),
1447 _values_per_roi(values_per_roi)
1454 return _feat_height;
1466 return _spatial_scale;
1472 return _values_per_roi;
1478 float _spatial_scale;
1479 size_t _values_per_roi;
1496 BoundingBoxTransformInfo(
float img_width,
float img_height,
float scale,
bool apply_scale =
false,
const std::array<float, 4> weights = { { 1.f, 1.f, 1.f, 1.f } },
bool correct_transform_coords =
1498 float bbox_xform_clip =
1500 : _img_width(img_width), _img_height(img_height), _scale(scale), _apply_scale(apply_scale), _correct_transform_coords(correct_transform_coords), _weights(weights), _bbox_xform_clip(bbox_xform_clip)
1511 return _bbox_xform_clip;
1531 return _apply_scale;
1536 return _correct_transform_coords;
1544 bool _correct_transform_coords;
1545 std::array<float, 4> _weights;
1546 float _bbox_xform_clip;
1581 : _act(f), _a(a), _b(
b), _enabled(true)
1609 bool _enabled = {
false };
1616 bool transpose_weights{
true };
1617 bool are_weights_reshaped{
false };
1618 bool retain_internal_weights{
false };
1619 bool fp_mixed_precision{
false };
1630 weights_trained_layout = layout;
1641 transpose_weights = should_transpose_weights;
1661 : _type(type), _norm_size(norm_size), _alpha(alpha), _beta(beta), _kappa(kappa), _is_scaled(is_scaled)
1702 return !is_cross_map();
1713 const uint32_t size = (_type ==
NormType::IN_MAP_2D) ? _norm_size * _norm_size : _norm_size;
1714 return (_is_scaled) ? (_alpha / size) : _alpha;
1719 uint32_t _norm_size;
1736 : _begin_mask(begin_mask), _end_mask(end_mask), _shrink_axis_mask(shrink_axis_mask)
1755 return _shrink_axis_mask;
1759 int32_t _begin_mask;
1761 int32_t _shrink_axis_mask;
1770 : _are_reshaped(false), _kernel_width(0), _kernel_height(0), _num_kernels(0), _retain_internal_weights(false)
1781 WeightsInfo(
bool are_reshaped,
unsigned int kernel_width,
unsigned int kernel_height,
unsigned int num_kernels,
bool retain_internal_weights =
false)
1782 : _are_reshaped(are_reshaped), _kernel_width(kernel_width), _kernel_height(kernel_height), _num_kernels(num_kernels), _retain_internal_weights(retain_internal_weights)
1791 return _are_reshaped;
1799 return _num_kernels;
1807 return std::make_pair(_kernel_width, _kernel_height);
1811 return _retain_internal_weights;
1816 unsigned int _kernel_width;
1817 unsigned int _kernel_height;
1818 unsigned int _num_kernels;
1819 bool _retain_internal_weights;
1836 : _m(1), _n(1), _k(1), _mult_transpose1xW_width(1), _mult_interleave4x4_height(1), _depth_output_gemm3d(0), _reinterpret_input_as_3d(false), _broadcast_bias(false)
1852 GEMMReshapeInfo(
int m,
int n,
int k,
int mult_transpose1xW_width = 1,
int mult_interleave4x4_height = 1,
int depth_output_gemm3d = 0,
bool reinterpret_input_as_3d =
false,
bool broadcast_bias =
false)
1853 : _m(m), _n(n), _k(k), _mult_transpose1xW_width(mult_transpose1xW_width), _mult_interleave4x4_height(mult_interleave4x4_height), _depth_output_gemm3d(depth_output_gemm3d),
1854 _reinterpret_input_as_3d(reinterpret_input_as_3d), _broadcast_bias(broadcast_bias)
1887 return _mult_transpose1xW_width;
1895 return _mult_interleave4x4_height;
1906 return _depth_output_gemm3d;
1914 return _reinterpret_input_as_3d;
1922 return _broadcast_bias;
1929 int _mult_transpose1xW_width;
1930 int _mult_interleave4x4_height;
1931 int _depth_output_gemm3d;
1932 bool _reinterpret_input_as_3d;
1933 bool _broadcast_bias;
1938 unsigned int c0{ 1 };
1955 int32_t gemmlowp_offset{ 0 };
1956 int32_t gemmlowp_multiplier{ 0 };
1957 int32_t gemmlowp_shift{ 0 };
1959 int32_t gemmlowp_max_bound{ std::numeric_limits<int32_t>::max() };
1960 std::vector<int32_t> gemmlowp_multipliers{};
1961 std::vector<int32_t> gemmlowp_shifts{};
1962 float gemmlowp_real_multiplier{ 0 };
1963 bool is_quantized_per_channel{
false };
1972 : m0(m), k0(k), v0(v),
transpose(trans), interleave(inter)
1975 unsigned int m0{ 1 };
1976 unsigned int k0{ 1 };
1977 unsigned int v0{ 1 };
1979 bool interleave{
true };
1986 GEMMRHSMatrixInfo(
unsigned int n,
unsigned int k,
unsigned int h,
bool trans,
bool inter,
bool export_to_cl_img)
1987 : n0(n), k0(k), h0(h),
transpose(trans), interleave(inter), export_to_cl_image(export_to_cl_img)
1990 unsigned int n0{ 1 };
1991 unsigned int k0{ 1 };
1992 unsigned int h0{ 1 };
1994 bool interleave{
true };
1995 bool export_to_cl_image{
false };
2008 : _is_a_reshaped(false),
2009 _is_b_reshaped(false),
2010 _reshape_b_only_on_first_run(true),
2011 _depth_output_gemm3d(0),
2012 _reinterpret_input_as_3d(false),
2013 _retain_internal_weights(false),
2014 _gemmlowp_output_stage(),
2015 _fp_mixed_precision(false),
2016 _broadcast_bias(false),
2017 _pretranpose_B(true),
2036 GEMMInfo(
bool is_a_reshaped,
bool is_b_reshaped,
bool reshape_b_only_on_first_run,
int depth_output_gemm3d = 0,
bool reinterpret_input_as_3d =
false,
bool retain_internal_weights =
false,
2039 : _is_a_reshaped(is_a_reshaped),
2040 _is_b_reshaped(is_b_reshaped),
2041 _reshape_b_only_on_first_run(reshape_b_only_on_first_run),
2042 _depth_output_gemm3d(depth_output_gemm3d),
2043 _reinterpret_input_as_3d(reinterpret_input_as_3d),
2044 _retain_internal_weights(retain_internal_weights),
2045 _gemmlowp_output_stage(gemmlowp_output_stage),
2046 _fp_mixed_precision(fp_mixed_precision),
2047 _broadcast_bias(broadcast_bias),
2048 _pretranpose_B(reshape_b_only_on_first_run),
2049 _activation_info(activation_info)
2058 return _is_a_reshaped;
2066 return _is_b_reshaped;
2076 return _reshape_b_only_on_first_run;
2084 return _depth_output_gemm3d;
2092 return _reinterpret_input_as_3d;
2100 return _retain_internal_weights;
2108 return _gemmlowp_output_stage;
2116 _gemmlowp_output_stage = output_stage;
2124 return _fp_mixed_precision;
2132 return _broadcast_bias;
2140 return _pretranpose_B;
2148 _pretranpose_B = flag;
2156 return _activation_info;
2164 _activation_info = activation_info;
2168 bool _is_a_reshaped;
2169 bool _is_b_reshaped;
2170 bool _reshape_b_only_on_first_run;
2171 int _depth_output_gemm3d;
2172 bool _reinterpret_input_as_3d;
2173 bool _retain_internal_weights;
2175 bool _fp_mixed_precision;
2176 bool _broadcast_bias;
2177 bool _pretranpose_B;
2193 : output_tile_size(output_tile_sz), kernel_size(kernel_sz), input_dimensions(input_dims), convolution_info(conv_info), output_data_layout(data_layout)
2234 unsigned int precision = 10,
2235 bool align_columns =
true,
2236 std::string element_delim =
" ",
2237 std::string row_delim =
"\n")
2238 : print_region(print_region),
2239 precision_type(precision_type),
2240 precision(precision),
2241 element_delim(element_delim),
2242 row_delim(row_delim),
2243 align_columns(align_columns)
2266 bool tracking_status{
false };
float scale_coeff() const
Return the scaling factor of the normalization function.
BorderMode
Methods available to handle borders.
ValidRegion(const Coordinates &an_anchor, const TensorShape &a_shape, size_t num_dimensions)
Constructor for a valid region with specified number of dimensions.
void set_pretranpose_B(bool flag)
Set pre-transpose b flag.
constexpr float SCALE_PYRAMID_ORB
Constant value used to indicate a ORB scaled pyramid.
Internal keypoint class for Lucas-Kanade Optical Flow.
DeconvolutionMethod
Available DeconvolutionMethod.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
ValidRegion & set(size_t dimension, int start, size_t size)
Accessor to set the value of anchor and shape for one of the dimensions.
GEMMLHSMatrixInfo(unsigned int m, unsigned int k, unsigned int v, bool trans, bool inter)
constexpr float SCALE_PYRAMID_HALF
Constant value used to indicate a half-scale pyramid.
unsigned int top
top of the border
L2-norm followed by clipping.
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.
ArithmeticOperation
Available element-wise operations.
InterpolationPolicy
Interpolation method.
int num_classes() const
Get num classes.
int mult_interleave4x4_height() const
Multiplication factor for the height of the 4x4 interleaved block.
Generate Proposals Information class.
Second channel (used by formats with unknown channel types).
DepthwiseConvolutionFunction
Available DepthwiseConvolutionFunction.
float kappa() const
Get the kappa value.
Quantize using a fixed point multiplication.
bool share_location() const
Get share location.
float im_width() const
Get image width (NMS may suppress boxes whose center sits beyond the image width) ...
FullyConnectedLayerInfo & set_weights_trained_layout(DataLayout layout)
Sets the weights trained data layout.
DetectionPostProcessLayerInfo(unsigned int max_detections, unsigned int max_classes_per_detection, float nms_score_threshold, float iou_threshold, unsigned int num_classes, std::array< float, 4 > scales_values, bool use_regular_nms=false, unsigned int detection_per_class=100, bool dequantize_scores=true)
Constructor.
float scale_value_x() const
Get x scale value.
float score_thresh() const
Get the score threshold.
DimensionRoundingType round() const
Get the rounding type.
quantized, symmetric fixed-point 16-bit number
void set_activation_info(const ActivationLayerInfo &activation_info)
Set activation layer info.
Use box centers and size.
ROIPoolingLayerInfo(unsigned int pooled_width, unsigned int pooled_height, float spatial_scale, unsigned int sampling_ratio=0)
Constructor.
TensorShape shape
Shape of the valid region.
WinogradInfo(Size2D output_tile_sz, Size2D kernel_sz, Size2D input_dims, PadStrideInfo conv_info, DataLayout data_layout)
Default constructor.
bool is_in_map() const
Check if normalization is not cross map.
bool enabled() const
Check if initialised.
GEMMRHSMatrixInfo(unsigned int n, unsigned int k, unsigned int h, bool trans, bool inter, bool export_to_cl_img)
std::vector< PaddingInfo > PaddingList
List of padding information.
ReductionOperation
Available reduction operations.
Container for 2D border size.
size_t values_per_roi() const
ActivationLayerInfo(ActivationFunction f, float a=0.0f, float b=0.0f)
Default Constructor.
std::map< int, std::vector< BBox > > LabelBBox
PhaseType
Phase calculation type.
unsigned int max_detections() const
Get max detections.
Direct 2D GEMM convolution.
DataLayoutDimension
[DataLayout enum definition]
BoxWithNonMaximaSuppressionLimit Information class.
PoolingLayerInfo(PoolingType pool_type, DataLayout data_layout)
Constructor.
uint32_t norm_size() const
Get the normalization size.
1 channel, 1 U8 per channel
NormType type() const
Get the normalization type.
int mult_transpose1xW_width() const
Multiplication factor for the width of the 1xW transposed block.
Terminate when within epsilon of a threshold.
float a() const
Get the alpha value.
GEMM reshape information class.
std::vector< float > aspect_ratios() const
Get aspect ratios.
PriorBoxLayerInfo(const std::vector< float > &min_sizes, const std::vector< float > &variances, float offset, bool flip=true, bool clip=false, const std::vector< float > &max_sizes={}, const std::vector< float > &aspect_ratios={}, const Coordinates2D &img_size=Coordinates2D{ 0, 0 }, const std::array< float, 2 > &steps={ { 0.f, 0.f } })
Constructor.
FullyConnectedLayerInfo & set_transpose_weights(bool should_transpose_weights)
Sets the transpose weights flag.
GEMMLowpOutputStageInfo gemmlowp_output_stage() const
GEMMLowp output stage.
bool are_reshaped() const
Flag which specifies if the weights tensor has been reshaped.
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
DimensionRoundingType
Dimension rounding type when down-scaling on CNNs.
Normalization Layer Information class.
Output values are defined by bilinear interpolation between the pixels.
bool is_cross_map() const
Check if normalization is cross map.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
const DataLayout data_layout
Fully connected layer info.
bool fp_mixed_precision() const
Flag which specifies if a wider accumulator should be used.
BilinearInterpolation
Bilinear Interpolation method used by LKTracker.
GEMM LHS (Left Hand Side) matrix information.
bool pretranpose_B() const
Flag which specifies whether b should be pre-transposed if supported.
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
Terminate after a maximum number of iterations.
constexpr uint8_t CONSTANT_BORDER_VALUE
Constant value of the border pixels when using BorderMode::CONSTANT.
PoolingLayerInfo()
Default Constructor.
GEMMReshapeInfo(int m, int n, int k, int mult_transpose1xW_width=1, int mult_interleave4x4_height=1, int depth_output_gemm3d=0, bool reinterpret_input_as_3d=false, bool broadcast_bias=false)
Constructor.
quantized, asymmetric fixed-point 16-bit number
ThresholdType
Threshold mode.
1 channel, 1 U16 per channel
unsigned int bottom
bottom of the border
float eta() const
Get eta.
int depth_output_gemm3d() const
Depth of the output when GEMM output is reinterpreted as 3D tensor.
unsigned int pooled_width() const
Get the pooled width of the layer.
unsigned int pad_top() const
Get the top padding.
Output values are defined to match the source pixel whose center is nearest to the sample position...
DetectionPostProcessLayerInfo()
Default Constructor.
bool retain_internal_weights() const
Flag which specifies if the weights tensor has to be retained from previous run.
DetectionOutputLayerCodeType
Available Detection Output code types.
ConvolutionMethod
Available ConvolutionMethod.
Activation Layer Information class.
decltype(strategy::transforms) typedef type
float spatial_scale() const
Terminate on whichever of the other conditions occurs first.
A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling.
bool use_regular_nms() const
Get if use regular nms.
int top_k() const
Get top K.
float feat_height() const
constexpr BorderSize(unsigned int top_bottom, unsigned int left_right)
Border with same size for top/bottom and left/right.
Copyright (c) 2017-2021 Arm Limited.
WeightsInfo()
Default constructor.
bool suppress_size() const
Get if NMS will suppress boxes based on their size/position.
bool is_b_reshaped() const
Flag which specifies if the matrix B has been reshaped.
ActivationFunction
Available activation functions.
1 channel, 1 F16 per channel
Samples are taken at pixel center.
Greater equal comparison ( )
float iou_threshold() const
Get intersection over union threshold.
BoxNMSLimitInfo(float score_thresh=0.05f, float nms=0.3f, int detections=100, bool soft_nms_enabled=false, NMSType soft_nms_method=NMSType::LINEAR, float soft_nms_sigma=0.5f, float soft_nms_min_score_thres=0.001f, bool suppress_size=false, float min_size=1.0f, float im_width=1.0f, float im_height=1.0f)
Constructor.
GenerateProposalsInfo(float im_width, float im_height, float im_scale, float spatial_scale=1.0, int pre_nms_topN=6000, int post_nms_topN=300, float nms_thres=0.7, float min_size=16.0, size_t values_per_roi=4)
Constructor.
NMSType
Available non maxima suppression types.
Convolution Layer Weights Information class.
DetectionOutputLayerInfo()
Default Constructor.
1 channel, 1 S32 per channel
bool variance_encoded_in_target() const
Get if variance encoded in target.
16-bit brain floating-point number
int n() const
Number of matrix B columns.
3 channels, 1 U8 per channel
Optimized Depthwise Convolution.
NormalizationLayerInfo(NormType type, uint32_t norm_size=5, float alpha=0.0001f, float beta=0.5f, float kappa=1.f, bool is_scaled=true)
Default Constructor.
FuseBatchNormalizationType
Available FuseBatchNormalizationType.
PoolingLayerInfo(PoolingType pool_type, Size2D pool_size, DataLayout data_layout, PadStrideInfo pad_stride_info=PadStrideInfo(), bool exclude_padding=false, bool fp_mixed_precision=false)
Constructor.
std::array< float, 2 > steps() const
Get the step coordinates.
float nms() const
Get the NMS.
float nms_threshold() const
Get nms threshold.
Third channel (used by formats with unknown channel types).
bool padding_is_symmetric() const
Check whether the padding is symmetric.
bool is_scaled() const
Get the is_scaled value.
1 channel, 1 U32 per channel
GEMM RHS (Right Hand Side) matrix information.
Normalization applied within the same map in 1D region.
Channel
Available channels.
Format
Image colour formats.
PaddingMode
Padding mode to use for PadLayer.
quantized, asymmetric fixed-point 8-bit number unsigned
size_t values_per_roi() const
int start(unsigned int d) const
Return the start of the valid region for the given dimension d.
float scale_value_h() const
Get h scale value.
std::pair< unsigned int, unsigned int > stride() const
Get the stride.
float scale_value_w() const
Get w scale value.
Pooling Layer Information struct.
float nms_score_threshold() const
Get nms threshold.
float soft_nms_min_score_thres() const
Get soft nms min score threshold.
BitwiseOperation
Available bitwise operations.
WeightsInfo(bool are_reshaped, unsigned int kernel_width, unsigned int kernel_height, unsigned int num_kernels, bool retain_internal_weights=false)
Constructor.
std::array< float, 4 > BBox
bool dequantize_scores() const
Get dequantize_scores value.
GEMMLowp output stage info.
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
Samples are taken at pixel top left corner.
float offset() const
Get the offset.
Fourth channel (used by formats with unknown channel types).
DetectionOutputLayerCodeType code_type() const
Get detection output code type.
unsigned int pad_right() const
Get the right padding.
float beta() const
Get the beta value.
int k() const
Number of matrix A columns or matrix B rows.
Quantize using a floating point multiplication.
Padding and stride information class.
ComparisonOperation
Supported comparison operations.
PoolingLayerInfo(PoolingType pool_type, unsigned int pool_size, DataLayout data_layout, PadStrideInfo pad_stride_info=PadStrideInfo(), bool exclude_padding=false, bool fp_mixed_precision=false)
Constructor.
GEMMLowpOutputStageType
GEMMLowp output stage type.
Termination
Termination criteria.
Coordinates2D img_size() const
Get the image size coordinates.
constexpr BorderSize(unsigned int size)
Border with equal size around the 2D plane.
float spatial_scale() const
unsigned int num_kernels() const
Return the number of convolution kernels.
bool reinterpret_input_as_3d() const
Flag which specifies if the input tensor has to be reinterpreted as 3D.
unsigned int left
left of the border
GEMMInfo() noexcept
Default constructor.
bool operator!=(const BorderSize &rhs)
Check non-equality with another BorderSize struct.
PriorBoxLayerInfo()
Default Constructor.
unsigned int right
right of the border
y*x if x < 0, x otherwise
Quantize using an integer multiplication.
1 channel, 1 S16 per channel
bool broadcast_bias() const
Flag which specifies whether to broadcast the shape of the bias tensor.
int keep_top_k() const
Get the number of total bounding boxes to be kept per image.
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
quantized, symmetric fixed-point 8-bit number
unsigned int sampling_ratio() const
Get sampling ratio.
Num samples, channels, height, width.
unsigned int max_classes_per_detection() const
Get max_classes per detection.
bool broadcast_bias() const
Flag which specifies whether to broadcast the shape of the bias tensor.
bool is_a_reshaped() const
Flag which specifies if the matrix A has been reshaped.
int round(float x, RoundingPolicy rounding_policy)
Return a rounded value of x.
float scale_value_y() const
Get y scale value.
PadStrideInfo(unsigned int stride_x, unsigned int stride_y, unsigned int pad_left, unsigned int pad_right, unsigned int pad_top, unsigned int pad_bottom, DimensionRoundingType round)
Constructor.
Strides of an item in bytes.
quantized, symmetric per channel fixed-point 8-bit number
Convolution using Winograd.
A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes.
float min_size() const
Get size suppression threshold.
PadStrideInfo(unsigned int stride_x=1, unsigned int stride_y=1, unsigned int pad_x=0, unsigned int pad_y=0, DimensionRoundingType round=DimensionRoundingType::FLOOR)
Constructor.
Detection Output layer info.
4 channels, 1 U8 per channel
ValidRegion(const Coordinates &an_anchor, const TensorShape &a_shape)
Constructor for a valid region with default number of dimensions.
PoolingType
Available pooling types.
PadStrideInfo pad_stride_info
GEMMReshapeInfo()
Default constructor.
void set_gemmlowp_output_stage(GEMMLowpOutputStageInfo &output_stage)
Sets GEMMLowp output stage.
constexpr bool empty() const
Check if the entire border is zero.
int32_t shrink_axis_mask() const
HOGNormType
Normalization type for Histogram of Oriented Gradients (HOG)
std::pair< uint32_t, uint32_t > PaddingInfo
Padding information as a pair of unsigned int start/end.
int end(unsigned int d) const
Return the end of the valid region for the given dimension d.
unsigned int pooled_height() const
Get the pooled height of the layer.
int m() const
Number of matrix A rows.
Borders are left undefined.
ROI Pooling Layer Information class.
Pixels outside the image are assumed to have the same value as the closest image pixel.
constexpr BorderSize()
Empty border, i.e.
Class for specifying the size of an image or rectangle.
Detection window used for the object detection.
std::vector< float > max_sizes() const
Get max sizes.
ComputeAnchors information class.
uint16_t width
Width of the rectangle.
Num samples, height, width, channels.
unsigned int detection_per_class() const
Get detection per class.
bool flip() const
Get the flip value.
2 channel, 1 U8 per channel
float spatial_scale() const
Get the spatial scale.
Less equal comparison ( )
Threshold with two values.
uint16_t y
Top-left y coordinate.
Detection Output layer info.
int depth_output_gemm3d() const
Depth (third dimension) of the output tensor to be used with the GEMM3D kernel.
constexpr bool uniform() const
Check if the border is the same size on all sides.
unsigned int num_classes() const
Get num classes.
Use box centers and size but flip x and y co-ordinates.
For Depthwise Convolution weights.
Use box centers and size.
std::vector< float > variances() const
Get min variances.
bool operator==(const BorderSize &rhs)
Check equality with another BorderSize struct.
bool reshape_b_only_on_first_run() const
Flag which specifies if the reshape of matrix B should executed only for the first.
constexpr BorderSize(unsigned int top, unsigned int right, unsigned int bottom, unsigned int left)
Border with different sizes.
uint16_t x
Top-left x coordinate.
float alpha() const
Get the alpha value.
SimpleTensor< T > transpose(const SimpleTensor< T > &src)
BorderSize operator*(float scale)
Scale a copy of this border size.
std::pair< unsigned int, unsigned int > pad() const
Get the padding.
DetectionOutputLayerInfo(int num_classes, bool share_location, DetectionOutputLayerCodeType code_type, int keep_top_k, float nms_threshold, int top_k=-1, int background_label_id=-1, float confidence_threshold=std::numeric_limits< float >::lowest(), bool variance_encoded_in_target=false, float eta=1)
Constructor.
ActivationFunction activation() const
Get the type of activation function.
float b() const
Get the beta value.
quantized, asymmetric fixed-point 8-bit number signed
64-bit floating-point number
Container for valid region of a window.
Threshold with one value.
MagnitudeType
Magnitude calculation type.
int post_nms_topN() const
uint16_t height
Height of the rectangle.
unsigned int pad_bottom() const
Get the bottom padding.
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
bool clip() const
Get the clip value.
GEMMInfo(bool is_a_reshaped, bool is_b_reshaped, bool reshape_b_only_on_first_run, int depth_output_gemm3d=0, bool reinterpret_input_as_3d=false, bool retain_internal_weights=false, GEMMLowpOutputStageInfo gemmlowp_output_stage=GEMMLowpOutputStageInfo(), bool fp_mixed_precision=false, bool broadcast_bias=false, const ActivationLayerInfo &activation_info=ActivationLayerInfo()) noexcept
Constructor.
DataType
Available data types.
bool reinterpret_input_as_3d() const
Flag which specifies if the input tensor has to be reinterpreted as 3D.
ActivationLayerInfo activation_info() const
Activation layer to apply after the matrix multiplication.
unsigned int pad_left() const
Get the left padding.
ElementWiseUnary
Available element wise unary operations.
DataLayout
[DataLayout enum definition]
std::vector< uint32_t > Multiples
Information to produce a tiled version of a Tensor.
NormType
The normalization type used for the normalization layer.
MatrixPattern
Available matrix patterns.
int32_t begin_mask() const
Normalization applied cross maps.
BorderSize & operator*=(float scale)
Scale this border size.
Any other matrix pattern.
ConvertPolicy
Policy to handle overflow.
NMSType soft_nms_method() const
Get soft NMS method.
void limit(const BorderSize &limit)
Limit this border size.
int background_label_id() const
Get background label ID.
float im_height() const
Get image height (NMS may suppress boxes whose center sits beyond the image height) ...
NonLinearFilterFunction
Available non linear functions.
Coordinates anchor
Anchor for the start of the valid region.
ValidRegion()
Default constructor.
float confidence_threshold() const
Get confidence threshold.
Normalization applied within the same map in 2D region.
bool retain_internal_weights() const
StridedSliceLayerInfo(int32_t begin_mask=0, int32_t end_mask=0, int32_t shrink_axis_mask=0)
Default Constructor.
SamplingPolicy
Available Sampling Policies.
float soft_nms_sigma() const
Get soft NMS sigma.
std::pair< unsigned int, unsigned int > kernel_size() const
Return the width and height of the kernel.
int num_loc_classes() const
Get number of location classes.
bool soft_nms_enabled() const
Check if soft NMS is enabled.
int detections_per_im() const
Get the number of detections.
Non linear median filter.
std::vector< float > min_sizes() const
Get min sizes.
bool has_padding() const
Check whether this has any padding.
ComputeAnchorsInfo(float feat_width, float feat_height, float spatial_scale, size_t values_per_roi=4)
Constructor.