🖼️ Stereo Image Inpainting Pipeline This script wraps the Simple-Lama-Inpainting library into a stereo-aware image processing pipeline. It pads input images, generates inpaint masks, fills missing regions, and outputs left/right stereo pairs with optional gutter spacing.
🚀 Quick Start
-
Create a Python 3.10 environment python -m venv lama_env source lama_env/bin/activate # or lama_env\Scripts\activate on Windows
-
Install dependencies pip install simple-lama-inpainting pillow numpy
-
Run the script python stereo_inpaint.py path/to/image.jpg --pad_percent 10 --gutter 50
🧠 What It Does Given an input image:
- Pads the image by a percentage of its largest dimension
- Creates a binary mask for the padded region
- Uses Simple-Lama to inpaint the masked area
- Crops the padded result to simulate a "right-eye" view
- Outputs:
- Left-eye image (*_L.jpg)
- Right-eye image (*_R.jpg)
- Stereo pair with gutter (*_lr.jpg)
⚙️ CLI Options
img_path [--pad_percent] [--gutter] [--l_and_r] [--debug] [--visual_debug]
--pad_percent is the offset between the two images. Note that the offset is imagened, not real. This defaults to 10%
--gutter is the space between the left and right image in the composit. It is specified in pixles. This defaults to 50 pixles.
--debug turns on text messages about the sizes of the images and how it is slicing them.
--l_and_r makes the program save individual l and r jpg images. Default is off.
--visual_debug makes the program save the intermediate steps so you get a jpg of the padded file with the space added to it, you get a jpg of the mask file, you get a jpg of the new file with the padded space imagined.