35 : _hog_detector_kernel(
std::make_unique<
CLHOGDetectorKernel>()), _detection_windows(nullptr), _num_detection_windows()
49 _detection_windows = detection_windows;
52 _num_detection_windows = cl::Buffer(
CLScheduler::get().context(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE,
sizeof(
unsigned int));
55 _hog_detector_kernel->configure(compile_context, input, hog, detection_windows, &_num_detection_windows, detection_window_stride, threshold, idx_class);
63 const unsigned int init_num_detection_windows = _detection_windows->
num_values();
64 q.enqueueWriteBuffer(_num_detection_windows, CL_FALSE, 0,
sizeof(
unsigned int), &init_num_detection_windows);
70 unsigned int num_detection_windows = 0;
71 q.enqueueReadBuffer(_num_detection_windows, CL_TRUE, 0,
sizeof(
unsigned int), &num_detection_windows);
74 _detection_windows->
resize(static_cast<size_t>(num_detection_windows));
void run() override
Run the kernels contained in the function.
static CLScheduler & get()
Access the scheduler singleton.
~CLHOGDetector()
Default destructor.
void resize(size_t num)
Resizes the array to contain "num" elements.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(const ICLTensor *input, const ICLHOG *hog, ICLDetectionWindowArray *detection_windows, const Size2D &detection_window_stride, float threshold=0.0f, size_t idx_class=0)
Initialise the kernel's input, output, HOG data object, detection window stride, threshold and index ...
Copyright (c) 2017-2021 Arm Limited.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
Interface for OpenCL Array.
size_t num_values() const
Number of values currently stored in the array.
OpenCL kernel to perform HOG detector kernel using linear SVM.
cl::CommandQueue & queue()
Accessor for the associated CL command queue.
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
Interface for OpenCL tensor.
Class for specifying the size of an image or rectangle.
CLHOGDetector()
Default constructor.
SimpleTensor< T > threshold(const SimpleTensor< T > &src, T threshold, T false_value, T true_value, ThresholdType type, T upper)
Interface for OpenCL HOG data-object.