UrielCh / opencv4nodejs

ESM Nodejs bindings to OpenCV 3/4
MIT License
254 stars 51 forks source link

TrackerNano implementation #165

Closed figamore closed 1 month ago

figamore commented 2 months ago

I have added bindings for using OpenCV's TrackerNano single object tracker, which is superior to any of the other available trackers (CSRT, MOSSE, TLD, etc.).

The changes allow a new TrackNano instance to be created by specifying the path of the backbone and neckhead model files in the "new cv.TrackerNano(backboneModelPath: String, neckheadModelPath)" constructor. All other methods, such as init and update, follow the convention and usage of the rest of the trackers.

UrielCh commented 2 months ago
figamore commented 2 months ago
  • clean cleanup your CV_VERSION_GREATER_EQUAL macro usage.
  • add a test unit.

Done.

UrielCh commented 2 months ago

ho nooooo !!!! Some checks were not successful

figamore commented 2 months ago

ho nooooo !!!! Some checks were not successful

Oh no! There was an issue with loading the model in the unit test. I have fixed it now.

figamore commented 2 months ago

@UrielCh, it looks like the test "Use openCV from Brew / build (4, 22) (pull_request)" failed due to an unrelated system fault. Could you please run it again?

UrielCh commented 1 month ago

all Tests pass, but the I still need to test mutiple openCV version.

UrielCh commented 1 month ago

I still get some Stack trace whene I use TrackerNano.

figamore commented 1 month ago

I still get some Stack trace whene I use TrackerNano.

Did you try it using the official TrackerNano model files here?

https://github.com/HonglinChu/SiamTrackers/tree/master/NanoTrack/models/nanotrackv2

UrielCh commented 1 month ago

I did some cleaning in the source tree moving all legacy tracker in a single file.

UrielCh commented 1 month ago

you commit the 2 models:

fdf592d3f946aa84775eecd1e388ab9f nanotrackv2/nanotrack_backbone_sim.onnx 7eb4bfeda369ece80218ef4070b9bef6 nanotrackv2/nanotrack_head_sim.onnx

is there something wrong with the V3 ?

could you please add an smple code in the "examples" folder ?

by the way the ackbone.onnx and neckhead.onnx file should be moved to the data folder

figamore commented 1 month ago

you commit the 2 models:

fdf592d3f946aa84775eecd1e388ab9f nanotrackv2/nanotrack_backbone_sim.onnx

7eb4bfeda369ece80218ef4070b9bef6 nanotrackv2/nanotrack_head_sim.onnx

is there something wrong with the V3 ?

I haven't tried the V3 models, but they should work just as well. I only included the V2 models so the tests run could run.

UrielCh commented 1 month ago

could you please add an smple code in the "examples" folder ?

by the way the ackbone.onnx and neckhead.onnx file should be moved to the data folder

Use the branch named 7.2.0 to make changes

https://github.com/UrielCh/opencv4nodejs/tree/7.2.0