semantic object removal made easy.
Project description
Semantic Object Removal
Using semantic segmentation and in-painting to remove objects based on labels. Inspired by Inpaint Anything by Tao Yu et al. Using MaskFormer for semantic segmentation to select areas to remove using LaMa for in-painting.
Installation
Install the package.
python -m pip install semremover
Use the SemanticObjectRemover
in your code.
from semremover import SemanticObjectRemover
sem_obj_remover = SemanticObjectRemover()
labels = ['car', 'minibike', 'van']
inpainted_image = sem_obj_remover.remove_objects_from_image("example.jpg", labels)
Development
Installation
Install the Python requirements.
python -m pip install -r requirements.txt
Usage
To use the script you can call it with various options. The first positional argument is the input path, which can point to either an image or a directory of images. To remove objects from a picture add them to the labels option when running the script. The default labels can be found in ./semremover/models/config/ade20k_labels.json
.
Example
input
python -m semremover example/paris.jpg --labels car minibike van
Output
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
Built Distribution
Hashes for semremover-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e1a5727b0942c0ec5f2ff9af997beb8015a44e7a9c878cb0afbea4a60c550d7 |
|
MD5 | ae8c753020a597e63d74c8e537715238 |
|
BLAKE2b-256 | b4f7b26cb96bc9cfab0274389de6bf177c35d06d7c7d19d8917077bf4562bc9d |