Skip to main content

The Prompt Challenge - Port visual ROI tracking algorithm to Metis - SiamFC


saadtiwana
Ensign
Forum|alt.badge.img+1
On-device visual ROI tracking - SiamFC on Metis M.2

Backstory:

It has been on my wish-list since last year to port a visual ROI tracking algorithm on Metis. I have posted about this before.

To be clear, visual ROI tracking algorithms are those that do not require an object detector, meaning you should be able to point them at anything and they track the object inside selected ROI (region of interest) in subsequent frames. You can imagine these are very useful for cases when you encounter objects that are not in the trained classes of your typical detection models.

Significance:

Since Metis is neither a general-purpose processor nor a GPU, accelerating typical OpenCV tracking algorithms on it is not feasible. Fortunately, researchers have developed neural networks for a wide range of tasks, including tracking. Metis is small, incredibly fast, and highly efficient, and its multiple cores can run several models simultaneously. So when it's already part of the system, why not use it to accelerate multiple tasks and leave the CPU to do easier things? 

When Axelera released Wingman (I was an early tester), I was excited because I could finally try porting, among other things, an ROI tracking algorithm to Metis.

And so began my journey...


Prompt(s):

I started with the most basic prompt. I even let the wingman help me choose:

I want to implement a visual object tracking algorithm on the Metis. To be clear, I am not talking about an object tracker that uses an object detector first, but a purely visual ROI tracker. My requirement is being able to track at least one selected ROI at a time (more is better but not necessary) and speed is critical. I want something that can be accelerated and run with very high FPS and low latency on the Metis. Review all the available options, cross check their architecture against what best suits the Metis architecture, and then tell me options sorted by most to least desirable. 2-3 top options at max. Any selected option must be possible to implement on Metis without any major roadblock.

Wingman came back with a table of options, with the most recommended family being “Siamese fully-convolutional (SiamFC, SiamRPN, SiamRPN++)”. It told me this was because the backbone is fully convolutional and head is cross-correlation of two feature maps, which was an excellent fit for Metis. 

At the time I started this, the on-device option was not there (only chat), so my next prompt was:

Let's deploy and test SiamFC on my RK3588 board with metis M.2. Give me step-by-step procedure for this. I will copy-paste to my board and follow along.

After that I was mostly being wingman’s wingman - i.e., helped copy-paste and run the commands on the actual device and report back on errors/progress. A few approach changes happened along the way, but eventually we had a working ROI tracker accelerated on Metis. 

Note: What the video below doesn’t capture too well is that the ROI is manually selected in frame 1. The selection could have been any ROI in the frame. 

 

Porting journey:

Following is high-level summary of what all was done during the porting process:

  • Chose SiamFC — fully convolutional, static shapes, single-ROI native → ideal for Metis INT8 MVM.

  • Converted pretrained checkpoint to Metis-friendly ONNX:

    • Expanded grouped convolutions (conv2/4/5, groups=2) to equivalent dense block-diagonal kernels.
    • Folded BatchNorm (conv1–4) into preceding convolutions; kept identity BN layers for clean export graph.
    • Compensated conv1 weights ×255 (checkpoint trained on 0–255; Voyager supplies 0–1).
    • Exported two static graphs: template [1,3,127,127], search [1,3,255,255].
  • Deployed with Voyager SDK:

    • Two YAMLs (AxONNXModel, identity normalization).
    • Calibration on ROI crops (~150 images per branch).
    • Quantized to INT8, compiled for Metis.
  • Runtime tracker (single Python file, low-level AxRuntime API):

    • Template kernel cached; three-scale search per frame.
    • Zero-mean + L2-normalized valid cross-correlation (per-channel sum), upsampled 16× with Hann window. 
       Normalized cross-correlation response

      Damped position/scale updates; interactive re-select (r), quit (Esc).

  • Validated with fixed-ROI diagnostic runs. Achieved ~390 FPS backbone / ~50–80 FPS full tracker on Metis M.2.

  •  

Final thoughts:

Overall, I was extremely impressed with wingman. During this whole process I had not needed to read a single documentation page - wingman helped me with everything. Something that would have taken me weeks to implement otherwise, I was able to accomplish in few days. This has changed the game for future experimentation and development on Axelera’s accelerators.

 

I have recorded all relevant files and detailed process of compiling the model via voyager in my github project:

github.com/SaadTiwana/siamfc-metis

 

What’s next:

My success with porting the SiamFC to Metis has given me the confidence boost I needed to pursue this further. Since visual ROI tracking is a topic that interests me (and I have actual uses for it), I plan to next go through the more start of art algorithms from the VOT (Visual Object Tracking) challenge and select some networks that are well suited for porting to Metis’ op-set. Once ported, this will give me even better algorithms for ROI tracking that don’t need to run on CPU or GPU and yet can be accelerated to insane speed on the Metis. 

I also do hope my models get picked for inclusion in the model zoo one day...for bragging rights ;)

4 replies

sshah
Cadet
  • Cadet
  • August 7, 2026

Good work on deploying SOT on metis.
How robust is the deployment to recovering lost tracks?


saadtiwana
Ensign
Forum|alt.badge.img+1
  • Author
  • Ensign
  • August 7, 2026

Thanks ​@sshah it had been on my list for a while so I am glad to see it work :)

Regarding the robustness, I haven’t had the chance to do any formal comparison with other algorithms yet, however, I was doing some other experiments on the same hardware (RK3588 board and same camera) with some more conventional ROI tracking algorithms (based on corner points, etc.) and I did notice that this siamfc port seemed to work noticeably better than those (I was trying them on same videos). I especially noticed that on a comparative scale, when the background was not clean, this one seemed to keep tracking much better than those. 

That said, this (siamfc) is still an older algorithm and I’m hoping to try more state-of-art algorithms in future to see how much better this can get. The main thing is to find an algorithm which has layers well supported by Metis. If you know any, pls do propose and I will give it a try (and share the result of course).


Spanner
Axelera Team
Forum|alt.badge.img+4
  • Axelera Team
  • August 11, 2026

Nice, you've already done it! 😃 You’re the man!

This is the bit of detection that has always frustrated me. A model knows its classes and that's the end of the conversation. Point it at something it's never been shown and it has nothing to say, no matter how obvious the thing is to you and me. And the real world is almost entirely made of objects that weren't in anybody's training set.

So being able to draw a box around “whatever that thing is” and have it followed could be mega useful. Handy that it's not a fringe use case either, given how much of Metis is about watching things move. I can’t get it to work on Frigate on my home CCTV for toffee. I need this!


saadtiwana
Ensign
Forum|alt.badge.img+1
  • Author
  • Ensign
  • August 13, 2026

Nice, you've already done it! 😃 You’re the man!

This is the bit of detection that has always frustrated me. A model knows its classes and that's the end of the conversation. Point it at something it's never been shown and it has nothing to say, no matter how obvious the thing is to you and me. And the real world is almost entirely made of objects that weren't in anybody's training set.

So being able to draw a box around “whatever that thing is” and have it followed could be mega useful. Handy that it's not a fringe use case either, given how much of Metis is about watching things move. I can’t get it to work on Frigate on my home CCTV for toffee. I need this!

I hear you. The reason I really wanted to get ROI tracking working on Metis is that if you already have such a nice accelerator in the system, why not utilize it to the max. In many use cases, you may not even be using all the cores so why not increase utilization of what you already have. Plus, the thing about ROI tracking algorithms is if you are able to run them at higher FPS, you get an advantage in terms of quality of tracking (i suppose because movements between two frame is smaller at higher fps, so better correlation).

I have identified two more algorithms that seem compatible with Metis op-set and should give even better tracking performance (SiamFC was released in 2016! so not the latest). For now I am out of Wingman credits, I’ll continue once I am back in business again :)