Skip to content

khysore/python.background_remove

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Background remover (MediaPipe)

This small utility removes image backgrounds using MediaPipe Selfie Segmentation and saves transparent PNGs.

Requirements

  • Python 3.8+
  • See requirements.txt for dependencies.

Install

Open PowerShell and run:

python -m pip install -r requirements.txt

Usage examples

Process a single image and save to a specific output path:

python scripts/remove_bg.py input.jpg --output out.png --transparent

Process a folder (glob) and save outputs in a directory:

python scripts/remove_bg.py "images\*.jpg" --outdir results --transparent --keep-filename

Composite on white background instead of transparency:

python scripts/remove_bg.py portrait.jpg --outdir results --bg-color 255,255,255

Notes

  • mediapipe works best on portraits/selfie-style photos. For general scenes results may vary.
  • If you want a more heavy-duty model (U2Net / rembg) consider using rembg, but that requires model downloads and larger dependencies.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages