mirror of
https://github.com/opencv/opencv.git
synced 2025-06-13 04:52:53 +08:00
add nanotrack v2 at regression test.
This commit is contained in:
parent
103212f209
commit
7dbb125a34
@ -851,9 +851,9 @@ public:
|
|||||||
|
|
||||||
/** @brief the Nano tracker is a super lightweight dnn-based general object tracking.
|
/** @brief the Nano tracker is a super lightweight dnn-based general object tracking.
|
||||||
*
|
*
|
||||||
* Nano tracker is much faster and extremely lightweight due to special model structure, the whole model size is about 1.1 MB.
|
* Nano tracker is much faster and extremely lightweight due to special model structure, the whole model size is about 1.9 MB.
|
||||||
* Nano tracker needs two models: one for feature extraction (backbone) and the another for localization (neckhead).
|
* Nano tracker needs two models: one for feature extraction (backbone) and the another for localization (neckhead).
|
||||||
* Please download these two onnx models at:https://github.com/HonglinChu/SiamTrackers/tree/master/NanoTrack/models/onnx.
|
* Please download these two onnx models at:https://github.com/HonglinChu/SiamTrackers/tree/master/NanoTrack/models/nanotrackv2.
|
||||||
* Original repo is here: https://github.com/HonglinChu/NanoTrack
|
* Original repo is here: https://github.com/HonglinChu/NanoTrack
|
||||||
* Author:HongLinChu, 1628464345@qq.com
|
* Author:HongLinChu, 1628464345@qq.com
|
||||||
*/
|
*/
|
||||||
|
@ -79,7 +79,7 @@ static bool checkIOU(const Rect& r0, const Rect& r1, double threshold)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void checkTrackingAccuracy(cv::Ptr<Tracker>& tracker, double iouThreshold = 0.8)
|
static void checkTrackingAccuracy(cv::Ptr<Tracker>& tracker, double iouThreshold = 0.7)
|
||||||
{
|
{
|
||||||
// Template image
|
// Template image
|
||||||
Mat img0 = imread(findDataFile("tracking/bag/00000001.jpg"), 1);
|
Mat img0 = imread(findDataFile("tracking/bag/00000001.jpg"), 1);
|
||||||
@ -136,7 +136,7 @@ TEST(DaSiamRPN, accuracy)
|
|||||||
checkTrackingAccuracy(tracker, 0.7);
|
checkTrackingAccuracy(tracker, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(NanoTrack, accuracy)
|
TEST(NanoTrack, accuracy_NanoTrack_V1)
|
||||||
{
|
{
|
||||||
std::string backbonePath = cvtest::findDataFile("dnn/onnx/models/nanotrack_backbone_sim.onnx", false);
|
std::string backbonePath = cvtest::findDataFile("dnn/onnx/models/nanotrack_backbone_sim.onnx", false);
|
||||||
std::string neckheadPath = cvtest::findDataFile("dnn/onnx/models/nanotrack_head_sim.onnx", false);
|
std::string neckheadPath = cvtest::findDataFile("dnn/onnx/models/nanotrack_head_sim.onnx", false);
|
||||||
@ -147,4 +147,17 @@ TEST(NanoTrack, accuracy)
|
|||||||
cv::Ptr<Tracker> tracker = TrackerNano::create(params);
|
cv::Ptr<Tracker> tracker = TrackerNano::create(params);
|
||||||
checkTrackingAccuracy(tracker);
|
checkTrackingAccuracy(tracker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(NanoTrack, accuracy_NanoTrack_V2)
|
||||||
|
{
|
||||||
|
std::string backbonePath = cvtest::findDataFile("dnn/onnx/models/nanotrack_backbone_sim_v2.onnx", false);
|
||||||
|
std::string neckheadPath = cvtest::findDataFile("dnn/onnx/models/nanotrack_head_sim_v2.onnx", false);
|
||||||
|
|
||||||
|
cv::TrackerNano::Params params;
|
||||||
|
params.backbone = backbonePath;
|
||||||
|
params.neckhead = neckheadPath;
|
||||||
|
cv::Ptr<Tracker> tracker = TrackerNano::create(params);
|
||||||
|
checkTrackingAccuracy(tracker, 0.69);
|
||||||
|
}
|
||||||
|
|
||||||
}} // namespace opencv_test::
|
}} // namespace opencv_test::
|
||||||
|
@ -10,8 +10,8 @@ For DaSiamRPN:
|
|||||||
kernel_r1: https://www.dropbox.com/s/999cqx5zrfi7w4p/dasiamrpn_kernel_r1.onnx?dl=0
|
kernel_r1: https://www.dropbox.com/s/999cqx5zrfi7w4p/dasiamrpn_kernel_r1.onnx?dl=0
|
||||||
kernel_cls1: https://www.dropbox.com/s/qvmtszx5h339a0w/dasiamrpn_kernel_cls1.onnx?dl=0
|
kernel_cls1: https://www.dropbox.com/s/qvmtszx5h339a0w/dasiamrpn_kernel_cls1.onnx?dl=0
|
||||||
For NanoTrack:
|
For NanoTrack:
|
||||||
nanotrack_backbone: https://github.com/HonglinChu/SiamTrackers/blob/master/NanoTrack/models/onnx/nanotrack_backbone_sim.onnx
|
nanotrack_backbone: https://github.com/HonglinChu/SiamTrackers/blob/master/NanoTrack/models/nanotrackv2/nanotrack_backbone_sim.onnx
|
||||||
nanotrack_headneck: https://github.com/HonglinChu/SiamTrackers/blob/master/NanoTrack/models/onnx/nanotrack_head_sim.onnx
|
nanotrack_headneck: https://github.com/HonglinChu/SiamTrackers/blob/master/NanoTrack/models/nanotrackv2/nanotrack_head_sim.onnx
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
tracker.py [-h] [--input INPUT] [--tracker_algo TRACKER_ALGO]
|
tracker.py [-h] [--input INPUT] [--tracker_algo TRACKER_ALGO]
|
||||||
|
Loading…
Reference in New Issue
Block a user