LaMa-ONNX / README.md
anodev's picture
Update README.md
ea0fcb6 verified
|
raw
history blame
1.91 kB
metadata
license: apache-2.0

LaMa Inpainting Model

This ONNX model is a port of the original PyTorch big-lama model.

Description

There are two versions of the model:

1. lama_fp32.onnx (RECOMMENDED)

This version was exported using the old torch to ONNX converter (torch.onnx.export).

Notes:

  1. Custom FourierUnitJIT: A custom FourierUnitJIT implementation is used since the original cannot be directly ported to ONNX without overhead. The result is identical to the original model.
  2. Fixed Input Shape: The input shape is fixed at 512x512 pixels. Although dynamic input shapes are possible, they would require resolving issues with dynamic padding in the irfft and rfftn functions in ffc.py.
  3. Opset Version 17: This model uses opset version 17.

if you need other resolution - export it using our jupyter notebook.

2. lama.onnx (NOT RECOMMENDED)

This version was exported using the new torch to ONNX converter (torch.onnx.dynamo_export).

Notes:

  1. Custom DFT irfftn Logic: Uses a custom irfftn ONNX logic (patched onnxscript).
  2. Fixed Input Shape: The input shape is fixed at 512x512 pixels.
  3. Opset Version 18: This model uses opset version 18.
  4. Performance: The model works slowly due to issues with torch.onnx.dynamo_export and optimization of the ONNX model.

Resources

Example

Original image: original image

lama_fp32.onnx - output: onnx output

lama.onnx - output: onnx output

Original model output: original model output