Skip to content

Tialo/replacer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Replacer

Tool for removing an object background and replacing it with neutral generated one.

Installation

git clone https://github.com/Tialo/replacer
cd replacer
pip install -r requirements.txt

Usage

To serve

python app.py

CLI

python -m replacer input.png output.png

How does it work?

  • Background is removed with rembg
  • New background is generated by Stable Diffusion model
  • Object is pasted into new background

Background generation comparison

For a comparison of different background generation models, see this table.

Example

pan pan_out

File organization

.
├── replacer
│   ├── __init__.py
│   ├── __main__.py              - CLI functionality
│   ├── app.py                   - Gradio application
│   ├── processing
│   │   ├── __init__.py
│   │   ├── adjust_image.py      - Tools for adjusting image propertiers
│   │   ├── normalization.py     - Different methods of color normalization
│   │   └── remove_background.py - Background removal functionality
│   ├── prompts.py               - List of item categories and corresponding prompts
│   └── replacer.py              - Main module for background replacement
└── requirements.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages