Auto-Lama combines object detection and image inpainting to automate object removals. It is build on top of DE:TR from Facebook Research and Lama from Samsung Research. The entire process is extremely simple:
There are currently a few ways of generating masks:
docker
make
conda
make build-conda-env
conda activate auto-lama
make build-env
make clean
The default config for the detector is
PARAMETERS = {
"model_name": "facebook/detr-resnet-50",
"threshold": 0.9,
"max_items": 10,
"save_destination": "./test_images",
"output_destination": "./output_images",
"max_width": 2000,
"max_height": 2000,
"resize": True,
"resize_scale": 0.75,
"excluded_objects": [91],
"image_format": "PNG",
"mask_target_items": [],
}
Please reference here for the target items that you want to mask, as the default DE:TR uses the COCO Dataset,
make detect_and_inpaint IMAGE_PATH=path/to/image
or make detect_and_inpaint IMAGE_PATH={image_url}