HailoRT in RUst

Dear community,

Apology, if this is not the place to post this.

I’m looking for people from the Hailo community and Hailo officials to rewrite the C++ to Rust. I’m unsure where to start, but I’ll research and re-read the HailoRT and Tapps-Core source code to better understand the starting point.

Please send me a dm if you are interested.

Thank you for being a pro-active community and enjoy your weekend!

Best,
Nino L.

Hi @nino
Thanks for bringing this up! If you’re looking to rewrite C++ into Rust or call C++ from Rust, here are some tools to consider:

cxx crate: Best for safe, high-level Rust-C++ interop.
bindgen: Automatically generates Rust bindings from C++ headers (C ABI).
cpp crate: Embed C++ directly into Rust for more control.
FFI: For manual, low-level integration.

You can follow Hailo’s Python binding code (using pybind) as a guide and convert it to Rust bindings.
HailoRT python binding is ‘pyHailort’ (import hailo_platfrom) code can be found here: https://github.com/hailo-ai/hailort/hailort/libhailort/bindings/python

TAPPAS python binding is hailo_python (import hailo) see code in https://github.com/hailo-ai/tappas/tree/master/core/hailo/plugins/python

Note that Hailo’s GStreamer implementation can be used with Rust, as GStreamer supports multiple languages, including Rust.

2 Likes

@giladn awesome insight. Thank you!

Where you able to make any progress on the Rust binding?

Hey nino!
This seems very intesteing.
How are you doing so far, is it possible to contribute in any way?

regard

I started my own project:

Simple object detection is working but now I want to make reading the hef parameters dynamic so users don’t need to know the names of all the input and output streams, their configs,…
I am trying to make a hef_manager that can read hefs and extract this info. Unfortunately I am stuck with the proto not being able to read the hef:
Running target/debug/hef_cli hef/centernet_resnet_v1_18_postprocess.hef
Parsed Magic: 0x01484546
Parsed Version: 1
Parsed Proto Size: 1912603
Parsed Header: HefHeader { magic: 21513542, version: 1, hef_proto_size: 1912603, details: V1 { crc: 3828573467, ccws_size: 10932176, reserved: 0 } }
Calculated Proto Offset: 10932200
Proto Data Size: 1912603, Offset: 10932200, Requested Size: 1912603
Proto data written to: proto_dump.pb.cc
Parsed Magic: 0x01484546
Parsed Version: 1
Parsed Proto Size: 1912603
Parsed Header: HefHeader { magic: 21513542, version: 1, hef_proto_size: 1912603, details: V1 { crc: 3828573467, ccws_size: 10932176, reserved: 0 } }
Calculated Proto Offset: 10932200
Proto Data Size: 1912603, Offset: 10932200, Requested Size: 1912603
Error parsing HEF file: Proto decode error at offset 10932200 with size 1912603: failed to decode Protobuf message: ProtoHefHef.network_groups: invalid wire type: SixtyFourBit (expected LengthDelimited)

Steps to reproduce:

  1. git clone GitHub - profitgrowinginnovator/hef_manager
  2. cd hef_manager
  3. cargo run --bin hef_cli hef/centernet_resnet_v1_18_postprocess.hef

Any help greatly appreciated

1 Like