diff options
author | John Richardson <john.richardson@arm.com> | 2018-01-09 11:17:00 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:49:16 +0000 |
commit | 684cb0f29d23fbe418e5e5347234abf9eccef363 (patch) | |
tree | 60731b6bb63b1a0dc997107d3bd55d8b4b82626b /src/core/CL | |
parent | 7da29b6b12ff319ed2b6e2c46588dfa1991556fb (diff) | |
download | ComputeLibrary-684cb0f29d23fbe418e5e5347234abf9eccef363.tar.gz |
COMPMID-596: Port HOGDetector to new validation
Change-Id: I73231fc71c5166268e6c909b7930b7e034f3794e
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118876
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL')
-rw-r--r-- | src/core/CL/cl_kernels/hog.cl | 14 | ||||
-rw-r--r-- | src/core/CL/kernels/CLHOGDescriptorKernel.cpp | 4 | ||||
-rw-r--r-- | src/core/CL/kernels/CLHOGDetectorKernel.cpp | 10 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/core/CL/cl_kernels/hog.cl b/src/core/CL/cl_kernels/hog.cl index 3d37fbcaf2..407ee2f3cf 100644 --- a/src/core/CL/cl_kernels/hog.cl +++ b/src/core/CL/cl_kernels/hog.cl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -351,7 +351,7 @@ __kernel void hog_block_normalization(IMAGE_DECLARATION(src), } #endif /* NUM_CELLS_PER_BLOCK_HEIGHT and NUM_BINS_PER_BLOCK_X and NUM_BINS_PER_BLOCK and HOG_NORM_TYPE and L2_HYST_THRESHOLD */ -#if defined(NUM_BLOCKS_PER_DESCRIPTOR_Y) && defined(NUM_BINS_PER_DESCRIPTOR_X) && defined(THRESHOLD) && defined(MAX_NUM_DETECTION_WINDOWS) && defined(IDX_CLASS) && defined(BLOCK_STRIDE_WIDTH) && defined(BLOCK_STRIDE_HEIGHT) && defined(DETECTION_WINDOW_WIDTH) && defined(DETECTION_WINDOW_HEIGHT) +#if defined(NUM_BLOCKS_PER_DESCRIPTOR_Y) && defined(NUM_BINS_PER_DESCRIPTOR_X) && defined(THRESHOLD) && defined(MAX_NUM_DETECTION_WINDOWS) && defined(IDX_CLASS) && defined(DETECTION_WINDOW_STRIDE_WIDTH) && defined(DETECTION_WINDOW_STRIDE_HEIGHT) && defined(DETECTION_WINDOW_WIDTH) && defined(DETECTION_WINDOW_HEIGHT) /** This OpenCL kernel computes the HOG detector using linear SVM * @@ -362,8 +362,8 @@ __kernel void hog_block_normalization(IMAGE_DECLARATION(src), * -# -DTHRESHOLD = Threshold for the distance between features and SVM classifying plane * -# -DMAX_NUM_DETECTION_WINDOWS = Maximum number of possible detection windows. It is equal to the size of the DetectioWindow array * -# -DIDX_CLASS = Index of the class to detect - * -# -DBLOCK_STRIDE_WIDTH = Block stride for the X direction - * -# -DBLOCK_STRIDE_HEIGHT = Block stride for the Y direction + * -# -DDETECTION_WINDOW_STRIDE_WIDTH = Detection window stride for the X direction + * -# -DDETECTION_WINDOW_STRIDE_HEIGHT = Detection window stride for the Y direction * -# -DDETECTION_WINDOW_WIDTH = Width of the detection window * -# -DDETECTION_WINDOW_HEIGHT = Height of the detection window * @@ -443,8 +443,8 @@ __kernel void hog_detector(IMAGE_DECLARATION(src), int id = atomic_inc(num_detection_windows); if(id < MAX_NUM_DETECTION_WINDOWS) { - dst[id].x = get_global_id(0) * BLOCK_STRIDE_WIDTH; - dst[id].y = get_global_id(1) * BLOCK_STRIDE_HEIGHT; + dst[id].x = get_global_id(0) * DETECTION_WINDOW_STRIDE_WIDTH; + dst[id].y = get_global_id(1) * DETECTION_WINDOW_STRIDE_HEIGHT; dst[id].width = DETECTION_WINDOW_WIDTH; dst[id].height = DETECTION_WINDOW_HEIGHT; dst[id].idx_class = IDX_CLASS; @@ -453,4 +453,4 @@ __kernel void hog_detector(IMAGE_DECLARATION(src), } } #endif /* NUM_BLOCKS_PER_DESCRIPTOR_Y && NUM_BINS_PER_DESCRIPTOR_X && THRESHOLD && MAX_NUM_DETECTION_WINDOWS && IDX_CLASS && - * BLOCK_STRIDE_WIDTH && BLOCK_STRIDE_HEIGHT && DETECTION_WINDOW_WIDTH && DETECTION_WINDOW_HEIGHT */ + * DETECTION_WINDOW_STRIDE_WIDTH && DETECTION_WINDOW_STRIDE_HEIGHT && DETECTION_WINDOW_WIDTH && DETECTION_WINDOW_HEIGHT */ diff --git a/src/core/CL/kernels/CLHOGDescriptorKernel.cpp b/src/core/CL/kernels/CLHOGDescriptorKernel.cpp index 87659c4ba9..a15aab1f37 100644 --- a/src/core/CL/kernels/CLHOGDescriptorKernel.cpp +++ b/src/core/CL/kernels/CLHOGDescriptorKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -172,7 +172,7 @@ void CLHOGBlockNormalizationKernel::configure(const ICLTensor *input, ICLTensor AccessWindowRectangle(input->info(), 0, 0, num_elems_read_per_iteration, num_rows_read_per_iteration), output_access); - output_access.set_valid_region(win, input->info()->valid_region()); + output_access.set_valid_region(win, ValidRegion(Coordinates(), output->info()->tensor_shape())); ICLKernel::configure(win); } diff --git a/src/core/CL/kernels/CLHOGDetectorKernel.cpp b/src/core/CL/kernels/CLHOGDetectorKernel.cpp index 0f9a98950d..caca49846f 100644 --- a/src/core/CL/kernels/CLHOGDetectorKernel.cpp +++ b/src/core/CL/kernels/CLHOGDetectorKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -70,10 +70,10 @@ void CLHOGDetectorKernel::configure(const ICLTensor *input, const ICLHOG *hog, I args_str << "-DTHRESHOLD=" << threshold << " "; args_str << "-DMAX_NUM_DETECTION_WINDOWS=" << detection_windows->max_num_values() << " "; args_str << "-DIDX_CLASS=" << idx_class << " "; - args_str << "-DBLOCK_STRIDE_WIDTH=" << block_stride.width << " "; - args_str << "-DBLOCK_STRIDE_HEIGHT=" << block_stride.height << " "; args_str << "-DDETECTION_WINDOW_WIDTH=" << detection_window_size.width << " "; args_str << "-DDETECTION_WINDOW_HEIGHT=" << detection_window_size.height << " "; + args_str << "-DDETECTION_WINDOW_STRIDE_WIDTH=" << detection_window_stride.width << " "; + args_str << "-DDETECTION_WINDOW_STRIDE_HEIGHT=" << detection_window_stride.height << " "; // Construct kernel name std::set<std::string> build_opts = {}; @@ -102,8 +102,8 @@ void CLHOGDetectorKernel::configure(const ICLTensor *input, const ICLHOG *hog, I // Configure kernel window Window win; - win.set(Window::DimX, Window::Dimension(0, floor_to_multiple(num_blocks_x - num_blocks_per_detection_window_x, window_step_x), window_step_x)); - win.set(Window::DimY, Window::Dimension(0, floor_to_multiple(num_blocks_y - num_blocks_per_detection_window_y, window_step_y), window_step_y)); + win.set(Window::DimX, Window::Dimension(0, floor_to_multiple(num_blocks_x - num_blocks_per_detection_window_x, window_step_x) + window_step_x, window_step_x)); + win.set(Window::DimY, Window::Dimension(0, floor_to_multiple(num_blocks_y - num_blocks_per_detection_window_y, window_step_y) + window_step_y, window_step_y)); constexpr unsigned int num_elems_read_per_iteration = 1; const unsigned int num_rows_read_per_iteration = num_blocks_per_descriptor_y; |