XFeat Compilation

There is some interest in the community in running the XFeat feature detection model on Hailo. It is included as part of the RPi community project Navigator.

Some pre-trained models are available but as indicated in this unanswered issue from a couple of months ago, there is missing calibration data and code required to compile the pytorch model into a HEF.

Has anyone had any luck find this stuff and re-training XFeat and compiling it to a HEF file?

The reason we want to re-train the feature detector is to optimise the feature descriptors for custom (underwater) imagery and therefore improve subsequent feature matching accuracy. Little point in re-training if we can’t compile the resulting model, though.

Thanks

Hey @julien.flack,

I see the split_onnx.py is missing - I’ll check it out with the makers of the community project and get it added there.

If you want to convert it to hailo8l, just download the resources from the navigator and run the script - you’ll need to edit it for each run to add --hw-arch hailo8l.

2 Likes

Hi @omria - any updates on the missing file?

There’s a repository that forks the original implementation. This repo replaces some layes in the network into mathematically equivalent layers so that it can compile for Hailo hardware.

• To convert the network to ONNX format, see:

• To compile the resulting ONNX model to HEF, use this script:

Note that this repo is a bit dated, and you’ll need to provide a calibration dataset from your own data. You may run into some friction, but it’s a solid step in the right direction.

2 Likes