1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Merge pull request #28637 from abhishek-gola:old_dnn_tickets_cleanup

Added Output Tensor Names support in new DNN engine #28637

closes: https://github.com/opencv/opencv/issues/26201

### 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:
Abhishek Gola
2026-03-26 17:37:56 +05:30
committed by GitHub
parent ea485c628c
commit 40ce5b4132
10 changed files with 122 additions and 45 deletions
@@ -59,13 +59,9 @@ class TrackerDaSiamRPNImpl : public TrackerDaSiamRPN
public:
TrackerDaSiamRPNImpl(const TrackerDaSiamRPN::Params& parameters)
{
// the tracker uses DNN models in quite sophisticated way,
// so it's not supported yet by the new engine.
// BUG: https://github.com/opencv/opencv/issues/26201
dnn::EngineType engine = dnn::ENGINE_CLASSIC;
siamRPN = dnn::readNet(parameters.model, "", "", engine);
siamKernelCL1 = dnn::readNet(parameters.kernel_cls1, "", "", engine);
siamKernelR1 = dnn::readNet(parameters.kernel_r1, "", "", engine);
siamRPN = dnn::readNet(parameters.model);
siamKernelCL1 = dnn::readNet(parameters.kernel_cls1);
siamKernelR1 = dnn::readNet(parameters.kernel_r1);
CV_Assert(!siamRPN.empty());
CV_Assert(!siamKernelCL1.empty());
@@ -180,8 +176,8 @@ void TrackerDaSiamRPNImpl::trackerInit(Mat img)
Mat r1 = siamKernelR1.forward();
std::vector<int> r1_shape = { 20, 256, 4, 4 }, cls1_shape = { 10, 256, 4, 4 };
siamRPN.setParam(siamRPN.getLayerId("onnx_node_output_0!65"), 0, r1.reshape(0, r1_shape));
siamRPN.setParam(siamRPN.getLayerId("onnx_node_output_0!68"), 0, cls1.reshape(0, cls1_shape));
siamRPN.setParam("onnx_node_output_0!65", 0, r1.reshape(0, r1_shape));
siamRPN.setParam("onnx_node_output_0!68", 0, cls1.reshape(0, cls1_shape));
}
bool TrackerDaSiamRPNImpl::update(InputArray image, Rect& boundingBox)