24 #ifndef ARM_COMPUTE_TYPES_H 25 #define ARM_COMPUTE_TYPES_H 205 : anchor{ an_anchor },
shape{ a_shape }
207 anchor.set_num_dimensions(std::max(anchor.num_dimensions(),
shape.num_dimensions()));
218 : anchor{ an_anchor },
shape{ a_shape }
221 anchor.set_num_dimensions(num_dimensions);
231 int end(
unsigned int d)
const 233 return anchor[d] +
shape[d];
246 anchor.
set(dimension, start);
247 shape.set(dimension, size);
285 constexpr
BorderSize(
unsigned int top_bottom,
unsigned int left_right)
286 : top{ top_bottom }, right{ left_right }, bottom{ top_bottom }, left{ left_right }
291 constexpr
BorderSize(
unsigned int top,
unsigned int right,
unsigned int bottom,
unsigned int left)
292 : top{ top }, right{ right }, bottom{ bottom }, left{ left }
299 return top == 0 && right == 0 && bottom == 0 && left == 0;
305 return top == right && top == bottom && top == left;
346 return (top == rhs.
top) && (right == rhs.
right) && (bottom == rhs.
bottom) && (left == rhs.
left);
357 return !(*
this == rhs);
366 top = std::min(top, limit.
top);
367 right = std::min(right, limit.
right);
368 bottom = std::min(bottom, limit.
bottom);
369 left = std::min(left, limit.
left);
520 uint16_t height{ 0 };
521 uint16_t idx_class{ 0 };
569 int detections = 100,
bool soft_nms_enabled =
false,
571 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)
572 : _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),
573 _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)
579 return _score_thresh;
589 return _detections_per_im;
594 return _soft_nms_enabled;
599 return _soft_nms_method;
604 return _soft_nms_sigma;
609 return _soft_nms_min_score_thres;
614 return _suppress_size;
635 int _detections_per_im;
636 bool _soft_nms_enabled;
638 float _soft_nms_sigma;
639 float _soft_nms_min_score_thres;
659 unsigned int pad_x = 0,
unsigned int pad_y = 0,
661 : _stride(
std::make_pair(stride_x, stride_y)),
680 unsigned int pad_left,
unsigned int pad_right,
681 unsigned int pad_top,
unsigned int pad_bottom,
683 : _stride(
std::make_pair(stride_x, stride_y)),
686 _pad_right(pad_right),
687 _pad_bottom(pad_bottom),
695 std::pair<unsigned int, unsigned int>
stride()
const 705 return (_pad_left == _pad_right) && (_pad_top == _pad_bottom);
713 std::pair<unsigned int, unsigned int>
pad()
const 717 return std::make_pair(_pad_left, _pad_top);
750 return (_pad_left != 0 || _pad_top != 0 || _pad_right != 0 || _pad_bottom != 0);
754 std::pair<unsigned int, unsigned int> _stride;
755 unsigned int _pad_left;
756 unsigned int _pad_top;
757 unsigned int _pad_right;
758 unsigned int _pad_bottom;
792 PriorBoxLayerInfo(
const std::vector<float> &min_sizes,
const std::vector<float> &variances,
float offset,
bool flip =
true,
bool clip =
false,
793 const std::vector<float> &max_sizes = {},
const std::vector<float> &aspect_ratios = {},
795 : _min_sizes(min_sizes),
796 _variances(variances),
800 _max_sizes(max_sizes),
805 _aspect_ratios.push_back(1.);
806 for(
unsigned int i = 0; i < aspect_ratios.size(); ++i)
808 float ar = aspect_ratios[i];
809 bool already_exist =
false;
810 for(
auto ar_new : _aspect_ratios)
812 if(fabs(ar - ar_new) < 1e-6)
814 already_exist =
true;
820 _aspect_ratios.push_back(ar);
823 _aspect_ratios.push_back(1.f / ar);
871 return _aspect_ratios;
875 std::vector<float> _min_sizes;
876 std::vector<float> _variances;
880 std::vector<float> _max_sizes;
881 std::vector<float> _aspect_ratios;
883 std::array<float, 2> _steps;
887 using BBox = std::array<float, 4>;
912 _background_label_id(),
913 _confidence_threshold(),
914 _variance_encoded_in_target(false),
918 _num_loc_classes = _share_location ? 1 : _num_classes;
935 : _num_classes(num_classes),
936 _share_location(share_location),
937 _code_type(code_type),
938 _keep_top_k(keep_top_k),
939 _nms_threshold(nms_threshold),
941 _background_label_id(background_label_id),
942 _confidence_threshold(confidence_threshold),
943 _variance_encoded_in_target(variance_encoded_in_target),
947 _num_loc_classes = _share_location ? 1 : _num_classes;
957 return _share_location;
967 return _variance_encoded_in_target;
977 return _nms_threshold;
987 return _background_label_id;
992 return _confidence_threshold;
1002 return _num_loc_classes;
1007 bool _share_location;
1010 float _nms_threshold;
1012 int _background_label_id;
1013 float _confidence_threshold;
1014 bool _variance_encoded_in_target;
1016 int _num_loc_classes;
1025 : _max_detections(),
1026 _max_classes_per_detection(),
1027 _nms_score_threshold(),
1032 _detection_per_class(),
1033 _dequantize_scores()
1048 DetectionPostProcessLayerInfo(
unsigned int max_detections,
unsigned int max_classes_per_detection,
float nms_score_threshold,
float iou_threshold,
unsigned int num_classes,
1049 std::array<float, 4> scales_values,
bool use_regular_nms =
false,
unsigned int detection_per_class = 100,
bool dequantize_scores =
true)
1050 : _max_detections(max_detections),
1051 _max_classes_per_detection(max_classes_per_detection),
1052 _nms_score_threshold(nms_score_threshold),
1053 _iou_threshold(iou_threshold),
1054 _num_classes(num_classes),
1055 _scales_values(scales_values),
1056 _use_regular_nms(use_regular_nms),
1057 _detection_per_class(detection_per_class),
1058 _dequantize_scores(dequantize_scores)
1064 return _max_detections;
1069 return _max_classes_per_detection;
1074 return _detection_per_class;
1079 return _nms_score_threshold;
1084 return _iou_threshold;
1089 return _num_classes;
1094 return _use_regular_nms;
1100 return _scales_values[0];
1106 return _scales_values[1];
1112 return _scales_values[2];
1118 return _scales_values[3];
1123 return _dequantize_scores;
1127 unsigned int _max_detections;
1128 unsigned int _max_classes_per_detection;
1129 float _nms_score_threshold;
1130 float _iou_threshold;
1131 unsigned int _num_classes;
1132 std::array<float, 4> _scales_values;
1133 bool _use_regular_nms;
1134 unsigned int _detection_per_class;
1135 bool _dequantize_scores;
1147 exclude_padding(false),
1148 is_global_pooling(false),
1149 fp_mixed_precision(false)
1167 bool exclude_padding =
false,
1168 bool fp_mixed_precision =
false)
1169 : pool_type(pool_type),
1170 pool_size(
Size2D(pool_size, pool_size)),
1171 data_layout(data_layout),
1172 pad_stride_info(pad_stride_info),
1173 exclude_padding(exclude_padding),
1174 is_global_pooling(false),
1175 fp_mixed_precision(fp_mixed_precision)
1194 bool exclude_padding =
false,
1195 bool fp_mixed_precision =
false)
1196 : pool_type(pool_type),
1197 pool_size(pool_size),
1198 data_layout(data_layout),
1199 pad_stride_info(pad_stride_info),
1200 exclude_padding(exclude_padding),
1201 is_global_pooling(false),
1202 fp_mixed_precision(fp_mixed_precision)
1214 : pool_type(pool_type),
1216 data_layout(data_layout),
1218 exclude_padding(false),
1219 is_global_pooling(true),
1220 fp_mixed_precision(false)
1244 ROIPoolingLayerInfo(
unsigned int pooled_width,
unsigned int pooled_height,
float spatial_scale,
unsigned int sampling_ratio = 0)
1245 : _pooled_width(pooled_width), _pooled_height(pooled_height), _spatial_scale(spatial_scale), _sampling_ratio(sampling_ratio)
1251 return _pooled_width;
1256 return _pooled_height;
1261 return _spatial_scale;
1266 return _sampling_ratio;
1270 unsigned int _pooled_width;
1271 unsigned int _pooled_height;
1272 float _spatial_scale;
1273 unsigned int _sampling_ratio;
1292 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,
1293 size_t values_per_roi = 4)
1294 : _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),
1295 _min_size(min_size), _values_per_roi(values_per_roi)
1317 return _pre_nms_topN;
1322 return _post_nms_topN;
1337 return _spatial_scale;
1342 return _values_per_roi;
1349 float _spatial_scale;
1354 size_t _values_per_roi;
1369 : _feat_height(feat_height),
1370 _feat_width(feat_width),
1371 _spatial_scale(spatial_scale),
1372 _values_per_roi(values_per_roi)
1379 return _feat_height;
1391 return _spatial_scale;
1397 return _values_per_roi;
1403 float _spatial_scale;
1404 size_t _values_per_roi;
1421 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 =
1423 float bbox_xform_clip =
1425 : _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)
1436 return _bbox_xform_clip;
1456 return _apply_scale;
1461 return _correct_transform_coords;
1469 bool _correct_transform_coords;
1470 std::array<float, 4> _weights;
1471 float _bbox_xform_clip;
1506 : _act(f), _a(a), _b(
b), _enabled(true)
1534 bool _enabled = {
false };
1544 bool transpose_weights{
true };
1545 bool are_weights_reshaped{
false };
1546 bool retain_internal_weights{
false };
1547 bool constant_weights{
true };
1549 bool fp_mixed_precision{
false };
1559 weights_trained_layout = layout;
1570 transpose_weights = should_transpose_weights;
1590 : _type(type), _norm_size(norm_size), _alpha(alpha), _beta(beta), _kappa(kappa), _is_scaled(is_scaled)
1631 return !is_cross_map();
1642 const uint32_t size = (_type ==
NormType::IN_MAP_2D) ? _norm_size * _norm_size : _norm_size;
1643 return (_is_scaled) ? (_alpha / size) : _alpha;
1648 uint32_t _norm_size;
1665 : _begin_mask(begin_mask), _end_mask(end_mask), _shrink_axis_mask(shrink_axis_mask)
1684 return _shrink_axis_mask;
1688 int32_t _begin_mask;
1690 int32_t _shrink_axis_mask;
1699 : _are_reshaped(false), _kernel_width(0), _kernel_height(0), _num_kernels(0), _retain_internal_weights(false)
1710 WeightsInfo(
bool are_reshaped,
unsigned int kernel_width,
unsigned int kernel_height,
unsigned int num_kernels,
bool retain_internal_weights =
false)
1711 : _are_reshaped(are_reshaped), _kernel_width(kernel_width), _kernel_height(kernel_height), _num_kernels(num_kernels), _retain_internal_weights(retain_internal_weights)
1720 return _are_reshaped;
1728 return _num_kernels;
1736 return std::make_pair(_kernel_width, _kernel_height);
1740 return _retain_internal_weights;
1745 unsigned int _kernel_width;
1746 unsigned int _kernel_height;
1747 unsigned int _num_kernels;
1748 bool _retain_internal_weights;
1765 : _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)
1781 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)
1782 : _m(m), _n(n), _k(k), _mult_transpose1xW_width(mult_transpose1xW_width), _mult_interleave4x4_height(mult_interleave4x4_height), _depth_output_gemm3d(depth_output_gemm3d),
1783 _reinterpret_input_as_3d(reinterpret_input_as_3d), _broadcast_bias(broadcast_bias)
1816 return _mult_transpose1xW_width;
1824 return _mult_interleave4x4_height;
1835 return _depth_output_gemm3d;
1843 return _reinterpret_input_as_3d;
1851 return _broadcast_bias;
1858 int _mult_transpose1xW_width;
1859 int _mult_interleave4x4_height;
1860 int _depth_output_gemm3d;
1861 bool _reinterpret_input_as_3d;
1862 bool _broadcast_bias;
1869 : pad_stride_info(pad_stride_info), depth_multiplier(depth_multiplier), act_info(act_info), dilation(dilation)
1873 unsigned int depth_multiplier{ 1 };
1891 int32_t gemmlowp_offset{ 0 };
1892 int32_t gemmlowp_multiplier{ 0 };
1893 int32_t gemmlowp_shift{ 0 };
1895 int32_t gemmlowp_max_bound{ std::numeric_limits<int32_t>::max() };
1896 std::vector<int32_t> gemmlowp_multipliers{};
1897 std::vector<int32_t> gemmlowp_shifts{};
1898 float gemmlowp_real_multiplier{ 0 };
1899 bool is_quantized_per_channel{
false };
1908 : m0(m), k0(k), v0(v),
transpose(trans), interleave(inter)
1911 unsigned int m0{ 1 };
1912 unsigned int k0{ 1 };
1913 unsigned int v0{ 1 };
1915 bool interleave{
true };
1922 GEMMRHSMatrixInfo(
unsigned int n,
unsigned int k,
unsigned int h,
bool trans,
bool inter,
bool export_to_cl_img)
1923 : n0(n), k0(k), h0(h),
transpose(trans), interleave(inter), export_to_cl_image(export_to_cl_img)
1926 unsigned int n0{ 1 };
1927 unsigned int k0{ 1 };
1928 unsigned int h0{ 1 };
1930 bool interleave{
true };
1931 bool export_to_cl_image{
false };
1944 : _is_a_reshaped(false),
1945 _is_b_reshaped(false),
1946 _reshape_b_only_on_first_run(true),
1947 _depth_output_gemm3d(0),
1948 _reinterpret_input_as_3d(false),
1949 _retain_internal_weights(false),
1950 _gemmlowp_output_stage(),
1952 _fp_mixed_precision(false),
1953 _broadcast_bias(false),
1954 _pretranpose_B(true),
1956 _constant_weights(true)
1976 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,
1979 : _is_a_reshaped(is_a_reshaped),
1980 _is_b_reshaped(is_b_reshaped),
1981 _reshape_b_only_on_first_run(reshape_b_only_on_first_run),
1982 _depth_output_gemm3d(depth_output_gemm3d),
1983 _reinterpret_input_as_3d(reinterpret_input_as_3d),
1984 _retain_internal_weights(retain_internal_weights),
1985 _gemmlowp_output_stage(gemmlowp_output_stage),
1986 _fast_math(fast_math),
1987 _fp_mixed_precision(fp_mixed_precision),
1988 _broadcast_bias(broadcast_bias),
1989 _pretranpose_B(reshape_b_only_on_first_run),
1990 _activation_info(activation_info),
1991 _constant_weights(constant_weights)
2000 return _is_a_reshaped;
2008 return _is_b_reshaped;
2018 return _reshape_b_only_on_first_run;
2026 return _depth_output_gemm3d;
2034 return _reinterpret_input_as_3d;
2042 return _retain_internal_weights;
2050 return _gemmlowp_output_stage;
2058 _gemmlowp_output_stage = output_stage;
2066 return _fp_mixed_precision;
2082 return _broadcast_bias;
2090 return _pretranpose_B;
2098 _pretranpose_B = flag;
2106 return _activation_info;
2114 _activation_info = activation_info;
2122 return _constant_weights;
2126 bool _is_a_reshaped;
2127 bool _is_b_reshaped;
2128 bool _reshape_b_only_on_first_run;
2129 int _depth_output_gemm3d;
2130 bool _reinterpret_input_as_3d;
2131 bool _retain_internal_weights;
2134 bool _fp_mixed_precision;
2135 bool _broadcast_bias;
2136 bool _pretranpose_B;
2138 bool _constant_weights;
2153 : output_tile_size(output_tile_sz), kernel_size(kernel_sz), input_dimensions(input_dims), convolution_info(conv_info), output_data_layout(data_layout)
2194 unsigned int precision = 10,
2195 bool align_columns =
true,
2196 std::string element_delim =
" ",
2197 std::string row_delim =
"\n")
2198 : print_region(print_region),
2199 precision_type(precision_type),
2200 precision(precision),
2201 element_delim(element_delim),
2202 row_delim(row_delim),
2203 align_columns(align_columns)
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.
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)
unsigned int top
top of the border
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.
ArithmeticOperation
Available element-wise operations.
bool constant_weights() const
Flag which specifies if the values of the weights tensor are constant throughout multiple executions ...
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
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.
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.
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
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.
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 fast_math=false, bool broadcast_bias=false, const ActivationLayerInfo &activation_info=ActivationLayerInfo(), bool constant_weights=true) noexcept
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
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.
ConvolutionInfo(const PadStrideInfo &pad_stride_info, unsigned int depth_multiplier, const ActivationLayerInfo &act_info, const Size2D &dilation)
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.
Coordinates2D img_size() const
Get the image size coordinates.
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
constexpr BorderSize(unsigned int size) noexcept
Border with equal size around the 2D plane.
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
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.
bool fast_math() const
Flag which specifies if a shorter accumulator to be used.
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.
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 ( )
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.
constexpr BorderSize() noexcept
Empty border, i.e.
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.
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.
int32_t begin_mask() const
Normalization applied cross maps.
BorderSize & operator*=(float scale)
Scale this border size.
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) ...
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.
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.