Classical Optical Flow and Neural Network-Based Optical Flow on Hailo Hardware

Hi everyone,

I’m wondering whether it is possible to deploy classical optical flow algorithms on Hailo hardware.

I’m particularly interested in Dense Inverse Search (DIS) Optical Flow, but I’m also open to alternative approaches if DIS itself cannot be deployed.

Does Hailo support any way of implementing or accelerating classical computer vision algorithms like optical flow, beyond standard neural network inference?

Additionally, has anyone already deployed neural network-based optical flow models on Hailo hardware? If so, I’d be very interested in hearing about your experiences, the models you used, and any challenges you encountered during deployment.

Are there any existing implementations, possible workarounds, or alternative approaches you would recommend for optical flow on Hailo?

Any insights, experiences, or pointers to relevant projects and documentation would be greatly appreciated!

Thanks!

Hi @Julius_Palsherm the DIS seems to be a classical computer vision model and therefore can’t run on Hailo device, which only run neural network models such as CNN or Transformers.
Although Hailo doesn’t offer any neural network-based optical flow model in the Hailo Model Zoo, FlowNetS-style simplest model should compile on Hailo:
Concatenate both RGB frames on the channel axis (6-channel input) and run a conv encoder with a deconv/resize decoder and multi-scale flow heads. Every op is on the supported list. The trade-off is accuracy: it is noticeably worse than RAFT on large displacements and fine detail. It’s fine for coarse motion fields (motion segmentation, ego-motion cues, activity triggers).

If you want to run RAFT: Split RAFT between host and Hailo (best accuracy, more integration work).

  • HEF #1: feature and context encoders, run once per frame pair. These are plain CNNs.
  • Host CPU: build the correlation pyramid (one matmul at 1/8 resolution) and do the per-iteration lookup.
  • HEF #2: the update block (motion encoder, ConvGRU, flow head). It uses only conv, sigmoid, tanh, and elementwise mul/add, all supported. Call it N times per frame pair.
  • Accumulate flow on the host in FP32 and take only the Δflow from the NPU. This avoids compounding int8 error across iterations.

Per-iteration transfers are small at 1/8 resolution, but the N round-trips add latency. Use 6–8 iterations rather than 12 or more, and benchmark with hailortcli run on both HEFs.