LaMa for Core ML
Big LaMa, the large-mask inpainting model, as a Core ML package, as used by the Erase tool of Gumka on macOS. It fills a masked area with what fits the picture around it. Its Fourier convolutions see the whole crop at once, so it handles large areas and repeating structure (brickwork, fences, foliage).
| Package | Input | Output |
|---|---|---|
LaMa.mlpackage | image 800 × 800 BGRA, 8-bit; mask 800 × 800, one channel, 8-bit (non-zero fills) | output 800 × 800 BGRA, 8-bit |
- The size is fixed. Gumka crops the picture around the mask, with context on every side, scales the crop to 800 × 800, and blends the fill back into the full-resolution picture.
- The weights are float32. Gumka runs it on CPU and GPU: about 0.7 s per run on a MacBook Air (Apple Silicon). The outputs of CPU, GPU and Neural Engine agree within 1/255.
- The ONNX version, for Linux, is gumka/lama-onnx.
Source and license
- Model: LaMa, "Resolution-robust Large Mask Inpainting with Fourier Convolutions", Roman Suvorov et al., 2021, https://arxiv.org/abs/2109.07161, https://github.com/advimman/lama (Apache-2.0).
- Core ML conversion: Daisuke Majima (john-rocky), from CoreML-Models, published at mlboydaisuke/LaMa-CoreML (Apache-2.0).
- This repository holds the package of mlboydaisuke/LaMa-CoreML at revision
5ed76e3799ab, unchanged; Gumka'smodels.tomlpins each file's size and SHA-256. License: Apache-2.0, seeLICENSE.