24.02.1
|
Go to the documentation of this file.
41 const int img_h = std::floor(bbinfo.
img_height() / bbinfo.
scale() + 0.5f);
42 const int img_w = std::floor(bbinfo.
img_width() / bbinfo.
scale() + 0.5f);
45 const auto scale_before = bbinfo.
scale();
61 const auto ptr =
reinterpret_cast<uint16_t *
>(box_it.
ptr());
66 const float width = (b2 / scale_before) - (b0 / scale_before) + 1.f;
67 const float height = (b3 / scale_before) - (b1 / scale_before) + 1.f;
68 const float ctr_x = (b0 / scale_before) + 0.5f * width;
69 const float ctr_y = (b1 / scale_before) + 0.5f * height;
70 for (
size_t j = 0; j < num_classes; ++j)
73 const size_t delta_id =
id.y() * deltas_width + 4u * j;
82 const float pred_ctr_x = dx * width + ctr_x;
83 const float pred_ctr_y = dy * height + ctr_y;
84 const float pred_w = std::exp(dw) * width;
85 const float pred_h = std::exp(dh) * height;
88 scale_after * utility::clamp<float>(pred_ctr_x - 0.5f * pred_w, 0.f, img_w - 1.f), pred_qinfo);
90 scale_after * utility::clamp<float>(pred_ctr_y - 0.5f * pred_h, 0.f, img_h - 1.f), pred_qinfo);
92 scale_after * utility::clamp<float>(pred_ctr_x + 0.5f * pred_w -
offset, 0.f, img_w - 1.f),
95 scale_after * utility::clamp<float>(pred_ctr_y + 0.5f * pred_h -
offset, 0.f, img_h - 1.f),
float dequantize_qasymm8(uint8_t value, const INFO_TYPE &qinfo)
Dequantize a value given an unsigned 8-bit asymmetric quantization scheme.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Interface for CPU tensor.
void bounding_box_transform_qsymm16(const ITensor *boxes, ITensor *pred_boxes, const ITensor *deltas, BoundingBoxTransformInfo bbinfo, const Window &window)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&...iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
Iterator updated by execute_window_loop for each window element.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
float dequantize_qasymm16(uint16_t value, const UniformQuantizationInfo &qinfo)
Dequantize a value given a 16-bit asymmetric quantization scheme.
UniformQuantizationInfo uniform() const
Return per layer quantization info.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
Describe a multidimensional execution window.
Copyright (c) 2017-2024 Arm Limited.
virtual size_t offset_first_element_in_bytes() const =0
The offset from the beginning of the memory allocation to the first element of the tensor.
uint16_t quantize_qasymm16(float value, const UniformQuantizationInfo &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given a 16-bit asymmetric quantization scheme.
virtual uint8_t * buffer() const =0
Interface to be implemented by the child class to return a pointer to CPU memory.