Skip to content

jaredyam/auto-inpainting

Repository files navigation

Auto-Inpainting

Recognize and remove needless foreground from photos in a smart way.

Installation

  1. Clone this repo to your local filesystem with dependent submodules
    (base) $ git clone --recurse-submodules https://github.com/jaredyam/auto-inpainting.git
  2. cd to the project directory and create a new virtual environment with conda
    (base) $ cd <path/to/auto-inpainting>
    (base) $ conda create --name auto-inpainting python=3.8
    (base) $ conda activate auto-inpainting
    (auto-inpainting) $ pip install -r requirements.txt

Inference

Before making inference, we need first prepare pre-trained models (from the original repo):

  • segmentation model:
    • U2Net: download the pre-trained model u2net.pth (176.3 MB) from GoogleDrive or Baidu Wangpan (code: pf9k) and put it into the directory ./segmentation-models/U-2-Net/saved_models/u2net/.
  • inpainting model:
    • LAMA: download the folder big-lama and put it in to the directory ./inpainting-models/lama/.

Then, make inference on a single image by running

(auto-inpainting) $ bash inference.sh <path/to/input-image>

Gallery

Original Demo

About

Recognize and remove foreground from photos.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published