23.11
|
Go to the documentation of this file.
42 _extrapolation_value(0),
56 float extrapolation_value)
63 extrapolation_value));
80 float extrapolation_value)
84 crop_size, method, extrapolation_value));
107 auto crop_tensor = std::make_unique<Tensor>();
110 crop_tensor->allocator()->init(crop_result_info);
112 auto scale_tensor = std::make_unique<Tensor>();
115 scale_tensor->allocator()->init(scaled_result_info);
117 auto crop_kernel = std::make_unique<NECropKernel>();
118 auto scale_kernel = std::make_unique<NEScale>();
121 _crop.emplace_back(std::move(crop_kernel));
124 _scale.emplace_back(std::move(scale_kernel));
136 _crop[i]->configure_output_shape();
@ CONSTANT
Pixels outside the image are assumed to have a constant value.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Class describing the value of a pixel for any image format.
@ NHWC
Num samples, height, width, channels.
@ TOP_LEFT
Samples are taken at pixel top left corner.
@ AREA
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
std::vector< std::unique_ptr< Tensor > > _scaled_results
InterpolationPolicy
Interpolation method.
Interface for CPU tensor.
static Status validate(const ITensorInfo *input, const ITensorInfo *boxes, const ITensorInfo *box_ind, const ITensorInfo *output, Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value)
Static function to check if given info will lead to a valid configuration of NESlice.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
float _extrapolation_value
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_NOT_IN(t,...)
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
static IScheduler & get()
Access the scheduler singleton.
ITensorInfo & set_data_layout(const DataLayout &data_layout) override
Set the data layout of the tensor.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT(...)
static Status validate(const ITensorInfo *input, const ITensorInfo *crop_boxes, const ITensorInfo *box_ind, const ITensorInfo *output, uint32_t crop_box_ind=0, float extrapolation_value=0)
Static function to check if given info will lead to a valid configuration of CLStridedSliceKernel.
~NECropResize()
Default destructor.
void configure(const ITensor *input, const ITensor *boxes, const ITensor *box_ind, ITensor *output, Coordinates2D crop_size, InterpolationPolicy method=InterpolationPolicy::BILINEAR, float extrapolation_value=0)
Configure kernel.
NECropResize()
Default constructor.
InterpolationPolicy _method
std::vector< std::unique_ptr< NEScale > > _scale
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
virtual std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
Store the tensor's metadata.
std::vector< std::unique_ptr< NECropKernel > > _crop
std::vector< std::unique_ptr< Tensor > > _crop_results
Copyright (c) 2017-2023 Arm Limited.
uint8_t * ptr_to_element(const Coordinates &id) const
Return a pointer to the element at the passed coordinates.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DIMENSIONS(...)
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
void run() override
Run the kernels contained in the function.
Store the tensor's metadata.
@ F32
32-bit floating-point number
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
#define ARM_COMPUTE_LOG_PARAMS(...)
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.