aboutsummaryrefslogtreecommitdiff
path: root/arm_compute
diff options
context:
space:
mode:
authorManuel Bottini <manuel.bottini@arm.com>2019-01-09 17:04:39 +0000
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-01-11 15:17:31 +0000
commitcc5171b85654b9f19a5f52bbe8abea0572ee0163 (patch)
tree032999b06aeced4f5e2963ab60c833acb951c3c8 /arm_compute
parent587708b05ca63fa88118daec82e2c39d63e60086 (diff)
downloadComputeLibrary-cc5171b85654b9f19a5f52bbe8abea0572ee0163.tar.gz
COMPMID-1677: Change ROIPooling layer interface to accept ROIs as tensors
Change-Id: If16b572a4d906187b77f32133a72a44316fa74e4 Reviewed-on: https://review.mlplatform.org/490 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r--arm_compute/core/CL/ICLArray.h4
-rw-r--r--arm_compute/core/CL/kernels/CLROIPoolingLayerKernel.h9
-rw-r--r--arm_compute/core/IArray.h5
-rw-r--r--arm_compute/core/NEON/kernels/NEROIPoolingLayerKernel.h11
-rw-r--r--arm_compute/core/Types.h9
-rw-r--r--arm_compute/graph/GraphBuilder.h2
-rw-r--r--arm_compute/runtime/Array.h4
-rw-r--r--arm_compute/runtime/CL/CLArray.h4
-rw-r--r--arm_compute/runtime/CL/functions/CLROIPoolingLayer.h7
-rw-r--r--arm_compute/runtime/NEON/functions/NEROIPoolingLayer.h9
10 files changed, 26 insertions, 38 deletions
diff --git a/arm_compute/core/CL/ICLArray.h b/arm_compute/core/CL/ICLArray.h
index 22fc7cf32e..eb57ea4ce3 100644
--- a/arm_compute/core/CL/ICLArray.h
+++ b/arm_compute/core/CL/ICLArray.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -121,8 +121,6 @@ using ICLKeyPointArray = ICLArray<KeyPoint>;
using ICLCoordinates2DArray = ICLArray<Coordinates2D>;
/** Interface for OpenCL Array of Detection Windows. */
using ICLDetectionWindowArray = ICLArray<DetectionWindow>;
-/** Interface for OpenCL Array of ROIs. */
-using ICLROIArray = ICLArray<ROI>;
/** Interface for OpenCL Array of 2D Sizes. */
using ICLSize2DArray = ICLArray<Size2D>;
/** Interface for OpenCL Array of uint8s. */
diff --git a/arm_compute/core/CL/kernels/CLROIPoolingLayerKernel.h b/arm_compute/core/CL/kernels/CLROIPoolingLayerKernel.h
index 93bfb3004c..106a4b9b6d 100644
--- a/arm_compute/core/CL/kernels/CLROIPoolingLayerKernel.h
+++ b/arm_compute/core/CL/kernels/CLROIPoolingLayerKernel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -52,7 +52,8 @@ public:
/** Set the input and output tensors.
*
* @param[in] input Source tensor. Data types supported: F16/F32.
- * @param[in] rois Array containing @ref ROI.
+ * @param[in] rois ROIs tensor, it is a 2D tensor of size [5, N] (where N is the number of ROIs) containing top left and bottom right corner
+ * as coordinate of an image and batch_id of ROI [ batch_id, x1, y1, x2, y2 ]. Data types supported: U16
* @param[out] output Destination tensor. Data types supported: Same as @p input.
* @param[in] pool_info Contains pooling operation information described in @ref ROIPoolingLayerInfo.
*
@@ -61,14 +62,14 @@ public:
* @note The z dimensions of @p output tensor and @p input tensor must be the same.
* @note The fourth dimension of @p output tensor must be the same as the number of elements in @p rois array.
*/
- void configure(const ICLTensor *input, const ICLROIArray *rois, ICLTensor *output, const ROIPoolingLayerInfo &pool_info);
+ void configure(const ICLTensor *input, const ICLTensor *rois, ICLTensor *output, const ROIPoolingLayerInfo &pool_info);
// Inherited methods overridden:
void run(const Window &window, cl::CommandQueue &queue) override;
private:
const ICLTensor *_input;
- const ICLROIArray *_rois;
+ const ICLTensor *_rois;
ICLTensor *_output;
ROIPoolingLayerInfo _pool_info;
};
diff --git a/arm_compute/core/IArray.h b/arm_compute/core/IArray.h
index f9e09a308b..35ab16c22a 100644
--- a/arm_compute/core/IArray.h
+++ b/arm_compute/core/IArray.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -34,7 +34,6 @@ struct KeyPoint;
struct Coordinates2D;
struct DetectionWindow;
class Size2D;
-struct ROI;
/** Array of type T */
template <class T>
@@ -142,8 +141,6 @@ using IKeyPointArray = IArray<KeyPoint>;
using ICoordinates2DArray = IArray<Coordinates2D>;
/** Interface for Array of Detection Windows. */
using IDetectionWindowArray = IArray<DetectionWindow>;
-/** Interface for Array of ROIs. */
-using IROIArray = IArray<ROI>;
/** Interface for Array of 2D Sizes. */
using ISize2DArray = IArray<Size2D>;
/** Interface for Array of uint8s. */
diff --git a/arm_compute/core/NEON/kernels/NEROIPoolingLayerKernel.h b/arm_compute/core/NEON/kernels/NEROIPoolingLayerKernel.h
index 5d9a7cfbf6..cae305ba43 100644
--- a/arm_compute/core/NEON/kernels/NEROIPoolingLayerKernel.h
+++ b/arm_compute/core/NEON/kernels/NEROIPoolingLayerKernel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -56,23 +56,24 @@ public:
/** Set the input and output tensors.
*
* @param[in] input Source tensor. Data types supported: F32.
- * @param[in] rois Array containing @ref ROI.
+ * @param[in] rois ROIs tensor, it is a 2D tensor of size [5, N] (where N is the number of ROIs) containing top left and bottom right corner
+ * as coordinate of an image and batch_id of ROI [ batch_id, x1, y1, x2, y2 ]. Data types supported: U16
* @param[out] output Destination tensor. Data types supported: Same as @p input.
* @param[in] pool_info Contains pooling operation information described in @ref ROIPoolingLayerInfo.
*
* @note The x and y dimensions of @p output tensor must be the same as that specified by @p pool_info 's pooled
* width and pooled height.
* @note The z dimensions of @p output tensor and @p input tensor must be the same.
- * @note The fourth dimension of @p output tensor must be the same as the number of elements in @p rois array.
+ * @note The fourth dimension of @p output tensor must be the same as the number of elements in @p rois tensor.
*/
- void configure(const ITensor *input, const IROIArray *rois, ITensor *output, const ROIPoolingLayerInfo &pool_info);
+ void configure(const ITensor *input, const ITensor *rois, ITensor *output, const ROIPoolingLayerInfo &pool_info);
// Inherited methods overridden:
void run(const Window &window, const ThreadInfo &info) override;
private:
const ITensor *_input;
- const IROIArray *_rois;
+ const ITensor *_rois;
ITensor *_output;
ROIPoolingLayerInfo _pool_info;
};
diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h
index 02001a2438..dc87617f55 100644
--- a/arm_compute/core/Types.h
+++ b/arm_compute/core/Types.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -501,13 +501,6 @@ using PaddingList = std::vector<PaddingInfo>;
/** Information to produce a tiled version of a Tensor */
using Multiples = std::vector<uint32_t>;
-/** Region of interest */
-struct ROI
-{
- Rectangle rect; /**< Rectangle specifying the region of interest */
- uint16_t batch_idx; /**< The batch index of the region of interest */
-};
-
/** Available channels */
enum class Channel
{
diff --git a/arm_compute/graph/GraphBuilder.h b/arm_compute/graph/GraphBuilder.h
index cb905e700e..b73f4f23ca 100644
--- a/arm_compute/graph/GraphBuilder.h
+++ b/arm_compute/graph/GraphBuilder.h
@@ -369,7 +369,7 @@ public:
* @param[in] g Graph to add the node to
* @param[in] params Common node parameters
* @param[in] input Input to the reshape layer node as a NodeID-Index pair
- * @param[in] rois Input containing @ref ROI.
+ * @param[in] rois Input containing the ROIs.
* @param[in] pool_info Contains pooling operation information described in @ref ROIPoolingLayerInfo.
*
* @return Node ID of the created node, EmptyNodeID in case of error
diff --git a/arm_compute/runtime/Array.h b/arm_compute/runtime/Array.h
index 4fc79026e0..0fe6dda047 100644
--- a/arm_compute/runtime/Array.h
+++ b/arm_compute/runtime/Array.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -67,8 +67,6 @@ using KeyPointArray = Array<KeyPoint>;
using Coordinates2DArray = Array<Coordinates2D>;
/** Array of Detection Windows. */
using DetectionWindowArray = Array<DetectionWindow>;
-/** Array of ROIs. */
-using ROIArray = Array<ROI>;
/** Array of 2D Sizes. */
using Size2DArray = Array<Size2D>;
/** Array of uint8s. */
diff --git a/arm_compute/runtime/CL/CLArray.h b/arm_compute/runtime/CL/CLArray.h
index 01c6d8df3d..3ff9eb801c 100644
--- a/arm_compute/runtime/CL/CLArray.h
+++ b/arm_compute/runtime/CL/CLArray.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -109,8 +109,6 @@ using CLKeyPointArray = CLArray<KeyPoint>;
using CLCoordinates2DArray = CLArray<Coordinates2D>;
/** OpenCL Array of Detection Windows. */
using CLDetectionWindowArray = CLArray<DetectionWindow>;
-/** OpenCL Array of ROIs. */
-using CLROIArray = CLArray<ROI>;
/** OpenCL Array of 2D Sizes. */
using CLSize2DArray = CLArray<Size2D>;
/** OpenCL Array of uint8s. */
diff --git a/arm_compute/runtime/CL/functions/CLROIPoolingLayer.h b/arm_compute/runtime/CL/functions/CLROIPoolingLayer.h
index f089375e51..70a3ba9c95 100644
--- a/arm_compute/runtime/CL/functions/CLROIPoolingLayer.h
+++ b/arm_compute/runtime/CL/functions/CLROIPoolingLayer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -45,7 +45,8 @@ public:
/** Set the input and output tensors.
*
* @param[in] input Source tensor. Data types supported: F16/F32.
- * @param[in] rois Array containing @ref ROI.
+ * @param[in] rois ROIs tensor, it is a 2D tensor of size [5, N] (where N is the number of ROIs) containing top left and bottom right corner
+ * as coordinate of an image and batch_id of ROI [ batch_id, x1, y1, x2, y2 ]. Data types supported: U16
* @param[out] output Destination tensor. Data types supported: Same as @p input.
* @param[in] pool_info Contains pooling operation information described in @ref ROIPoolingLayerInfo.
*
@@ -54,7 +55,7 @@ public:
* @note The z dimensions of @p output tensor and @p input tensor must be the same.
* @note The fourth dimension of @p output tensor must be the same as the number of elements in @p rois array.
*/
- void configure(const ICLTensor *input, const ICLROIArray *rois, ICLTensor *output, const ROIPoolingLayerInfo &pool_info);
+ void configure(const ICLTensor *input, const ICLTensor *rois, ICLTensor *output, const ROIPoolingLayerInfo &pool_info);
};
}
#endif /* __ARM_COMPUTE_CLROIPOOLINGLAYER_H__ */
diff --git a/arm_compute/runtime/NEON/functions/NEROIPoolingLayer.h b/arm_compute/runtime/NEON/functions/NEROIPoolingLayer.h
index 69a90dd89a..cf41552694 100644
--- a/arm_compute/runtime/NEON/functions/NEROIPoolingLayer.h
+++ b/arm_compute/runtime/NEON/functions/NEROIPoolingLayer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -47,7 +47,8 @@ public:
/** Set the input and output tensors.
*
* @param[in] input Source tensor. Data types supported: F32.
- * @param[in] rois Array containing @ref ROI.
+ * @param[in] rois ROIs tensor, it is a 2D tensor of size [5, N] (where N is the number of ROIs) containing top left and bottom right corner
+ * as coordinate of an image and batch_id of ROI [ batch_id, x1, y1, x2, y2 ]. Data types supported: U16
* @param[out] output Destination tensor. Data types supported: Same as @p input.
* @param[in] pool_info Contains pooling operation information described in @ref ROIPoolingLayerInfo.
*
@@ -56,7 +57,7 @@ public:
* @note The z dimensions of @p output tensor and @p input tensor must be the same.
* @note The fourth dimension of @p output tensor must be the same as the number of elements in @p rois array.
*/
- void configure(const ITensor *input, const IROIArray *rois, ITensor *output, const ROIPoolingLayerInfo &pool_info);
+ void configure(const ITensor *input, const ITensor *rois, ITensor *output, const ROIPoolingLayerInfo &pool_info);
// Inherited methods overridden:
void run() override;
@@ -64,5 +65,5 @@ public:
private:
NEROIPoolingLayerKernel _roi_kernel;
};
-}
+} // namespace arm_compute
#endif /* __ARM_COMPUTE_NEROIPOOLINGLAYER_H__ */