twn39 / lama

🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022

  • Public
  • 2.4K runs
  • Paper

Run time and cost

This model costs approximately $0.018 to run on Replicate, or 55 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on Nvidia A40 (Large) GPU hardware. Predictions typically complete within 25 seconds. The predict time for this model varies significantly based on the inputs.

Readme

Modern image inpainting systems, despite the significant progress, often struggle with large missing areas, complex geometric structures, and high-resolution images. We find that one of the main reasons for that is the lack of an ef-fective receptive field in both the inpainting network andthe loss function. To alleviate this issue, we propose anew method called large mask inpainting (LaMa). LaM ais based on:

* a new inpainting network architecture that uses fast Fourier convolutions, which have the image-widereceptive field
* a high receptive field perceptual loss;
* large training masks, which unlocks the potential ofthe first two components.

Our inpainting network improves the state-of-the-art across a range of datasets and achieves excellent performance even in challenging scenarios, e.g.completion of periodic structures. Our model generalizes surprisingly well to resolutions that are higher than thoseseen at train time, and achieves this at lower parameter & compute costs than the competitive baselines.