advimman / lama

🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022
https://advimman.github.io/lama-project/
Apache License 2.0
7.62k stars 821 forks source link

ONNX Model #316

Closed OPHoperHPO closed 1 month ago

OPHoperHPO commented 2 months ago

Changelog:

  1. Added a custom FourierUnitJIT class, exportable using the torch.onnx.export converter (should give identical results to the original torch implementation).
  2. Added information about the ONNX model in the README.
  3. Added a Colab notebook for exporting the model to ONNX.

How to activate FourierUnitJIT:

You need to add the use_jit boolean config field in config.yaml under generator/resnet_conv_kwargs, like this: config.generator.resnet_conv_kwargs.use_jit = True.

It is turned off by default and should be compatible with the original code.