accelerated_features icon indicating copy to clipboard operation
accelerated_features copied to clipboard

[Feature Inquiry] ONNX export support for lighterglue model

Open Teddywesside1 opened this issue 10 months ago • 12 comments

Hi! Thanks for your great work! We are exploring ways to deploy the model in cross-platform environments.

We've attempted several approaches to export the model, but encountered persistent issues.

Would there be an official script/tutorial for exporting the lighterglue model to ONNX format?

Teddywesside1 avatar Mar 12 '25 00:03 Teddywesside1

Hey Teddy,

I've added LighterGlue ONNX export in my fork here: https://github.com/stschake/accelerated_features/commit/acecc1561a60fc30904f0a79e0def825fc7224d1

stschake avatar Mar 17 '25 21:03 stschake

Hey Teddy,

I've added LighterGlue ONNX export in my fork here: stschake@acecc15

Wow, thank you so much for sharing this! This is incredibly helpful for me!

Teddywesside1 avatar Mar 18 '25 06:03 Teddywesside1

This has same implement, easy export and with onnx demo.

noahzhy avatar Mar 28 '25 08:03 noahzhy

This has same implement, easy export and with onnx demo.

您好,我尝试了使用了您的项目,非常好。但是我注意到和原版的lightgule相差较大,我在想精度上是否会有损失,请问您是否在Megadepth1500上测试过精度。

zw-92 avatar Apr 10 '25 08:04 zw-92

Which original version of LightGlue did you mean? As we know, this repo uses a much lighter version called LighterGlue, which has L=6 and only one attention head.

noahzhy avatar Apr 10 '25 08:04 noahzhy

Which original version of LightGlue did you mean? As we know, this repo uses a much lighter version called LighterGlue, which has L=6 and only one attention head.

我执行onnx_runnner.py文件在自己的数据集上验证,发现精度很差。您用于验证的图片可能过于简单了,最好还是放到整个数据集上评估转为onnx后的模型精度。

zw-92 avatar Apr 10 '25 09:04 zw-92

pls pull the last commit code in my repo. a bug has fixed and one more thing is onnx is not support dynamic control flow, which means onnx not support width_confidence early stop in paper of lightglue.

noahzhy avatar Apr 10 '25 10:04 noahzhy

pls pull the last commit code in my repo. a bug has fixed and one more thing is onnx is not support dynamic control flow, which means onnx not support width_confidence early stop in paper of lightglue.

非常感谢您的修复,我重新尝试了,已经成功了。但是我在尝试在Megadepth-1500上评估作者的XFeat+Lightglue模型,发现精度很差,有时候几何验证甚至会报错(因为符合条件的点数太少)。您是否在公共数据集上评估过您的模型。期待您的回复。

zw-92 avatar Apr 15 '25 03:04 zw-92

No, I didn't evaluate my onnx model file on any public dataset, it's just a simple model export without any training, and the exported model prediction result is as same as this repo..

noahzhy avatar Apr 15 '25 03:04 noahzhy

是的,我已经尝试你的仓库了,它运行成功,但是精度非常差

Derkai52 avatar Jun 07 '25 15:06 Derkai52

是的,我已经尝试你的仓库了,它运行成功,但是精度非常差

Well, this is strange, because our company's product also uses the same ONNX export method. It works very well and is about to be put into production. And in principle, this kind of export should not have any impact on accuracy.

noahzhy avatar Jun 07 '25 15:06 noahzhy

Hey Teddy,

I've added LighterGlue ONNX export in my fork here: stschake@acecc15

Thanks!

Derkai52 avatar Jun 11 '25 03:06 Derkai52