How to run SiamRPN tracker on hailo-8l device?

I am using a hailo-8l, connected to raspberry pi 5. I want to run SiamRPN model or any other tracking model(I don’t want detection+tracking) in hailo-8l device. If there is any way, please provide or tell me how to do it.

Hey @Gummadi_Akhil,

Welcome to the Hailo community!

What we currently support:
Tracking in our existing apps (like person tracking with --detector person) works by running detection first, then using a post-processing tracker like DeepSORT or ByteTrack on the host CPU.

The issue with SiamRPN:
SiamRPN is a tracking-only model that needs frame-to-frame feature correlation with a Siamese backbone. Unfortunately, this type of model isn’t natively supported or optimized for Hailo devices right now. We don’t have direct support for pure tracking models that skip the detection stage.

Your options:
If you really want to do tracking on the Hailo-8L, here’s what I’d suggest:

Option 1: Hybrid approach
Run detection on the Hailo-8L and tracking on the Pi 5 CPU. This is the pattern we use in our RPi examples - you can hide the detection boxes and just feed the results to your tracker.

Option 2: Custom SiamRPN port (pretty advanced)
You could try porting SiamRPN or a lightweight version like Tiny-SiamRPN through ONNX to Hailo HEF via our Dataflow Compiler. But heads up - you’ll probably run into issues with the Siamese structure not compiling efficiently, and our compiler is really optimized for static dataflows rather than dynamic template matching.

Let me know which direction you want to go with this and if you need anything else !

Hi @omria,

Thanks you for your response. For my application, I can not use hybrid approach. I need to use tracking model only. I tried to convert the SiamRPN.onnx model into SiamRPN.hef format. I installed hailo-ai software suite - docker. I created a SiamRPN.yaml file for the model to compile. I ran into some issuses.

network:
  network_name: siamrpn
  paths:
    network_path:
      - /local/workspace/siamrpn.onnx
    url: "http://localhost/siamrpn.onnx"  # Dummy URL

parser:
  nodes:
    - template
    - search
    - cls
    - loc
  start_node_shapes:
    template: [1, 3, 127, 127]
    search: [1, 3, 271, 271]

preprocessing:
  network_type: custom

evaluation:
  dataset_name: GOT-10k
  classes: 1
  labels_offset: 0

targets:
  - device: hailo8l

I am getting this error

(hailo_virtualenv) hailo@RDS-HYD-LT-096:/local/workspace$ hailomz compile --ckpt ./siamrpn.onnx --calib-path ./car_images --yaml ./SiamRPN.yaml --hw-arch hailo8l
<Hailo Model Zoo INFO> Start run for network siamrpn ...
<Hailo Model Zoo INFO> Initializing the hailo8l runner...
Traceback (most recent call last):
  File "/local/workspace/hailo_virtualenv/bin/hailomz", line 33, in <module>
    sys.exit(load_entry_point('hailo-model-zoo', 'console_scripts', 'hailomz')())
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main.py", line 122, in main
    run(args)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main.py", line 111, in run
    return handlers[args.command](args)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py", line 248, in compile
    _ensure_optimized(runner, logger, args, network_info)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py", line 73, in _ensure_optimized
    _ensure_parsed(runner, logger, network_info, args)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py", line 108, in _ensure_parsed
    parse_model(runner, network_info, ckpt_path=args.ckpt_path, results_dir=args.results_dir, logger=logger)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py", line 126, in parse_model
    raise Exception(f"Encountered error during parsing: {err}") from None
Exception: Encountered error during parsing: Expecting value: line 1 column 1 (char 0)

Can you please check my yaml file and also can you please, tell me in detail way how to do this.