Skip to main content

No project description provided

Project description

simple-lama-inpainting

Simple pip package for LaMa[1] inpainting.
PyPI version

Installation

pip install simple-lama-inpainting

Usage

CLI

simple_lama <path_to_input_image> <path_to_mask_image> <path_to_output_image>

Integration to Your Code

Input formats: np.ndarray or PIL.Image.Image. (3 channel input image & 1 channel binary mask image where pixels with 255 will be inpainted).
Output format: PIL.Image.Image

from simple_lama_inpainting import SimpleLama
from PIL import Image

simple_lama = SimpleLama()

img_path = "image.png"
mask_path = "mask.png"

image = Image.open(img_path)
mask = Image.open(mask_path).convert('L')

result = simple_lama(image, mask)
result.save("inpainted.png")

Sources

[1] Suvorov, R., Logacheva, E., Mashikhin, A., Remizova, A., Ashukha, A., Silvestrov, A., Kong, N., Goka, H., Park, K., & Lempitsky, V. (2021). Resolution-robust Large Mask Inpainting with Fourier Convolutions. arXiv preprint arXiv:2109.07161.
[2] https://github.com/saic-mdal/lama
[3] https://github.com/Sanster/lama-cleaner

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_lama_inpainting_updated-0.1.3.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file simple_lama_inpainting_updated-0.1.3.tar.gz.

File metadata

File hashes

Hashes for simple_lama_inpainting_updated-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d2dda6333b620052ffa492cc0aa5836f59cdad8127ac7f4efcb8a2d32a960ca2
MD5 18021ac16e4bf3834316e71a203ae8dc
BLAKE2b-256 5b41812529c611dba2865d2161ea73caa31ec4c968cccf1a1b8589a9c7581513

See more details on using hashes here.

File details

Details for the file simple_lama_inpainting_updated-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_lama_inpainting_updated-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 43429275c55be14f59cea357d8ab7f022efc2d17612bdf2ae70cb72bade7e751
MD5 001f8e6807a34e0872f728d117af02d1
BLAKE2b-256 9c5069f040e5772c71e1dcfc64b9afceb2a611e7d8590944a087f13bf53e363f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page