mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge pull request #24092 from Aser-Abdelfatah:GSoC_Support_GatherElements_ONNX
GSoC Add ONNX Support for GatherElements #24092 Merge with: https://github.com/opencv/opencv_extra/pull/1082 Adds support to the ONNX operator GatherElements [operator docs](https://github.com/onnx/onnx/blob/main/docs/Operators.md#GatherElements) Added tests to opencv_extra at pull request https://github.com/opencv/opencv_extra/pull/1082 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
@@ -343,6 +343,22 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
static Ptr<GatherLayer> create(const LayerParams& params);
|
||||
};
|
||||
|
||||
/** @brief GatherElements layer
|
||||
* GatherElements takes two inputs data and indices of the same rank r >= 1 and an optional attribute axis and works such that:
|
||||
* output[i][j][k] = data[index[i][j][k]][j][k] if axis = 0 and r = 3
|
||||
* output[i][j][k] = data[i][index[i][j][k]][k] if axis = 1 and r = 3
|
||||
* output[i][j][k] = data[i][j][index[i][j][k]] if axis = 2 and r = 3
|
||||
*
|
||||
* Gather, on the other hand, takes a data tensor of rank r >= 1, and indices tensor of rank q, and works such that:
|
||||
* it gathers the enteries along axis dimension of the input data indexed by indices and concatenates them in an output tensor of rank q + (r - 1)
|
||||
* e.g. If axis = 0, let k = indices[i_{0}, ..., i_{q-1}] then output[i_{0}, ..., i_{q-1}, j_{0}, ..., j_{r-2}] = input[k , j_{0}, ..., j_{r-2}]:
|
||||
**/
|
||||
class CV_EXPORTS GatherElementsLayer : public Layer
|
||||
{
|
||||
public:
|
||||
static Ptr<GatherElementsLayer> create(const LayerParams& params);
|
||||
};
|
||||
|
||||
class CV_EXPORTS PoolingLayer : public Layer
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user