Android object tracking speed up

Hi, I have the following problem.

I am coding an application that detects objects, tracks them and displays information about them in real time.

For detection, I am using Yolov8 model and opencv Dnn module, which works well.
For tracking I tried MIL tracker, but it is very slow. I t can handle only 5fps.
I need at leas 10fps throughput.

My ideas:

  1. try a different tracker - I wanted to try some different trackers from opencv-contrib, but failed to build opencv sdk with contrib modules.
  2. multi threading - process frames in different thread, not sure how the synchronization would work
  3. rewrite the tracking part in C++ - I have no idea, what kind o speedup it could give.

Please, if you cold give me your insights about these three options (or if you think of any other solution), I would be very grateful.