1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-22 16:08:41 +08:00

Added possibility of getting any intermediate blob with thrifty memory management

This commit is contained in:
Aleksandr Rybnikov
2017-06-13 16:23:01 +03:00
committed by Maksim Shabunin
parent b18e35793a
commit aa0d8060de
18 changed files with 351 additions and 206 deletions

View File

@@ -172,11 +172,10 @@ bool TrackerGOTURNImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
Mat targetBlob = dnn::blobFromImage(targetPatch);
Mat searchBlob = dnn::blobFromImage(searchPatch);
net.setBlob(".data1", targetBlob);
net.setBlob(".data2", searchBlob);
net.setInput(targetBlob, ".data1");
net.setInput(searchBlob, ".data2");
net.forward();
Mat resMat = net.getBlob("scale").reshape(1, 1);
Mat resMat = net.forward("scale").reshape(1, 1);
curBB.x = targetPatchRect.x + (resMat.at<float>(0) * targetPatchRect.width / INPUT_SIZE) - targetPatchRect.width;
curBB.y = targetPatchRect.y + (resMat.at<float>(1) * targetPatchRect.height / INPUT_SIZE) - targetPatchRect.height;