[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71047":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":39,"readmeContent":40,"aiSummary":41,"trendingCount":16,"starSnapshotCount":16,"syncStatus":42,"lastSyncTime":43,"discoverSource":44},71047,"backgroundremover","nadermx\u002Fbackgroundremover","nadermx","Background Remover lets you Remove Background from images and video using AI with a simple command line interface that is free and open source.","https:\u002F\u002Fwww.backgroundremoverai.com",null,"Python",7914,646,49,9,0,4,13,41,12,39.43,"MIT License",false,"main",true,[27,28,29,5,30,31,32,33,34,35,36,37,38],"ai","background-removal","background-remover","photo-editing","python","pytorch","remove-background","remove-background-image","remove-background-video","removebackground","video","video-editing","2026-06-12 02:02:47","# BackgroundRemover\n![Background Remover](https:\u002F\u002Fraw.githubusercontent.com\u002Fnadermx\u002Fbackgroundremover\u002Fmain\u002Fexamplefiles\u002Fbackgroundremoverexample.png)\n\u003Cimg alt=\"background remover video\" src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fnadermx\u002Fbackgroundremover\u002Fmain\u002Fexamplefiles\u002Fbackgroundremoverprocessed.gif\" height=\"200\" \u002F>\u003Cbr>\nBackgroundRemover is a command line tool to remove background from [image](https:\u002F\u002Fgithub.com\u002Fnadermx\u002Fbackgroundremover#image) and [video](https:\u002F\u002Fgithub.com\u002Fnadermx\u002Fbackgroundremover#video) using AI, made by [nadermx](https:\u002F\u002Fjohn.nader.mx) to power [https:\u002F\u002FBackgroundRemoverAI.com](https:\u002F\u002Fbackgroundremoverai.com). If you wonder why it was made read this [short blog post](https:\u002F\u002Fjohnathannader.com\u002Fmy-first-open-source-project\u002F).\u003Cbr>\n\n\n### Requirements\n\n* python >= 3.6\n* python3.6-dev #or what ever version of python you use\n* torch and torchvision stable version (https:\u002F\u002Fpytorch.org)\n* ffmpeg 4.4+\n\n* To clarify, you must install both python and whatever dev version of python you installed. IE; python3.10-dev with python3.10 or python3.8-dev with python3.8\n\n#### How to install torch and ffmpeg\n\nGo to https:\u002F\u002Fpytorch.org and scroll down to `INSTALL PYTORCH` section and follow the instructions.\n\n**For CPU-only (default):**\n\n```bash\npip3 install torch torchvision --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcpu\n```\n\n**For GPU (CUDA) support:**\n\n```bash\n# For CUDA 11.8\npip3 install torch torchvision --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n\n# For CUDA 12.1\npip3 install torch torchvision --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\n```\n\nVisit https:\u002F\u002Fpytorch.org\u002Fget-started\u002Flocally\u002F to find the correct command for your CUDA version.\n\n**To install ffmpeg and python-dev:**\n\n```bash\nsudo apt install ffmpeg python3.6-dev\n```\n\n### Installation\nTo Install backgroundremover, install it from pypi\n\n```bash\npip install --upgrade pip\npip install backgroundremover\n```\nPlease note that when you first run the program, it will check to see if you have the u2net models, if you do not, it will pull them from this repo\n\nIt is also possible to run this without installing it via pip, just clone the git to local start a virtual env and install requirements and run\n```bash\npython -m backgroundremover.cmd.cli -i \"video.mp4\" -mk -o \"output.mov\"\n```\nand for windows\n```bash\npython.exe -m backgroundremover.cmd.cli -i \"video.mp4\" -mk -o \"output.mov\"\n```\n### Installation using Docker\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fnadermx\u002Fbackgroundremover.git\ncd backgroundremover\ndocker build -t bgremover .\n# Basic usage (models will be downloaded on each run)\nalias backgroundremover='docker run -it --rm -v \"$(pwd):\u002Ftmp\" bgremover:latest'\n\n# Recommended: Persist models between runs to avoid re-downloading\nmkdir -p ~\u002F.u2net\nalias backgroundremover='docker run -it --rm -v \"$(pwd):\u002Ftmp\" -v \"$HOME\u002F.u2net:\u002Froot\u002F.u2net\" bgremover:latest'\n\n# For video processing: Increase shared memory to avoid multiprocessing errors\nalias backgroundremover='docker run -it --rm --shm-size=2g -v \"$(pwd):\u002Ftmp\" -v \"$HOME\u002F.u2net:\u002Froot\u002F.u2net\" bgremover:latest'\n```\n\n**Note for Docker video processing:** Video processing uses multiprocessing which requires adequate shared memory. If you encounter errors like `OSError: [Errno 95] Operation not supported`, use `--shm-size=2g` (or higher) or `--ipc=host` when running the container.\n\n### GPU Acceleration\n\nBackgroundRemover automatically detects and uses your GPU if available, which provides significant speed improvements (typically 5-10x faster than CPU).\n\n**To verify GPU is being used:**\n\n```bash\npython3 -c \"import torch; print('GPU available:', torch.cuda.is_available()); print('GPU name:', torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'N\u002FA')\"\n```\n\n**Troubleshooting GPU issues:**\n\n1. **GPU not detected**: Ensure you installed the CUDA-compatible version of PyTorch (see installation instructions above)\n2. **Out of memory errors**: Reduce GPU batch size with `-gb 1` flag\n3. **Slow performance on CPU**: Install CUDA-compatible PyTorch for GPU acceleration\n4. **CUDA version mismatch**: Match your PyTorch CUDA version with your system's CUDA installation\n\nThe tool will automatically fall back to CPU if GPU is not available or encounters errors.\n\n### Usage as a cli\n## Image\n\nRemove the background from a local file image\n\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -o \"output.png\"\n```\n\nSupported image formats: `.jpg`, `.jpeg`, `.png`, `.heic`, `.heif` (HEIC\u002FHEIF support requires pillow-heif)\n### Process all images in a folder\n\nYou can now remove backgrounds from all supported image or video files in a folder using the `--input-folder` (`-if`) option. You can also optionally set an output folder using `--output-folder` (`-of`). If `--output-folder` is not provided, the outputs will be saved in the same input folder, prefixed with `output_`.\n\n### Example: Folder of Images\n\n```bash\nbackgroundremover -if \"\u002Fpath\u002Fto\u002Fimage-folder\" -of \"\u002Fpath\u002Fto\u002Foutput-folder\"\n```\n\nThis will process all `.jpg`, `.jpeg`, `.png`, `.heic`, and `.heif` images in the folder and save the results to the output folder.\n\n\n\n### Advance usage for image background removal\n\n**Alpha Matting for Better Edge Quality:**\n\nBy default, backgroundremover produces soft, natural edges. For some use cases (like cartoons, graphics, or sharp-edged objects), you may want sharper edges or better edge refinement.\n\n```bash\n# Enable alpha matting for refined edges\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -a -o \"output.png\"\n\n# Adjust erosion size for sharper\u002Fsofter edges (default: 10)\n# Smaller values (1-5) = sharper, harder edges (good for cartoons\u002Fgraphics)\n# Larger values (15-25) = softer, more natural edges (good for portraits)\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -a -ae 5 -o \"output.png\"\n```\n\n**Alpha matting parameters:**\n- `-a` - Enable alpha matting\n- `-af` - Foreground threshold (default: 240)\n- `-ab` - Background threshold (default: 10)\n- `-ae` - Erosion size (1-25, default: 10) - controls edge sharpness\n- `-az` - Base size (default: 1000) - affects processing resolution\n\n**Change the model for different subjects:**\n\n```bash\n# For humans\u002Fpeople - most accurate for human subjects\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -m \"u2net_human_seg\" -o \"output.png\"\n\n# For general objects - good all-around model (default)\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -m \"u2net\" -o \"output.png\"\n\n# Faster processing - lower accuracy but quicker\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -m \"u2netp\" -o \"output.png\"\n```\n\n### Output only the mask (binary mask\u002Fmatte)\n\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -om -o \"mask.png\"\n```\n\n### Replace background with a custom color\n\n```bash\n# Replace with red background\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -bc \"255,0,0\" -o \"output.png\"\n\n# Replace with green background\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -bc \"0,255,0\" -o \"output.png\"\n\n# Replace with blue background\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -bc \"0,0,255\" -o \"output.png\"\n```\n\n### Replace background with a custom image\n\n```bash\n# Replace background with another image\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fimage.jpeg\" -bi \"\u002Fpath\u002Fto\u002Fbackground.jpg\" -o \"output.png\"\n```\n\n### Use with pipes (stdin\u002Fstdout)\n\nYou can use backgroundremover in Unix pipelines by reading from stdin and writing to stdout:\n\n```bash\n# Read from stdin, write to stdout\ncat input.jpg | backgroundremover > output.png\n\n# Use with other tools in a pipeline\ncurl https:\u002F\u002Fexample.com\u002Fimage.jpg | backgroundremover | convert - -resize 50% smaller.png\n\n# Equivalent explicit syntax\nbackgroundremover -i - -o - \u003C input.jpg > output.png\n```\n\nNote: Pipe mode assumes image input (not video).\n\n### Run as HTTP API Server\n\nYou can run backgroundremover as an HTTP API server:\n\n```bash\n# Start server on default port 5000\nbackgroundremover-server\n\n# Specify custom host and port\nbackgroundremover-server --addr 0.0.0.0 --port 8080\n```\n\nAPI Usage:\n\n```bash\n# Upload image via POST\ncurl -X POST -F \"file=@image.jpg\" http:\u002F\u002Flocalhost:5000\u002F -o output.png\n\n# Process from URL via GET\ncurl \"http:\u002F\u002Flocalhost:5000\u002F?url=https:\u002F\u002Fexample.com\u002Fimage.jpg\" -o output.png\n\n# With alpha matting\ncurl \"http:\u002F\u002Flocalhost:5000\u002F?url=https:\u002F\u002Fexample.com\u002Fimage.jpg&a=true&af=240\" -o output.png\n\n# Choose model\ncurl \"http:\u002F\u002Flocalhost:5000\u002F?url=https:\u002F\u002Fexample.com\u002Fimage.jpg&model=u2net_human_seg\" -o output.png\n```\n\nParameters:\n- `a` - Enable alpha matting\n- `af` - Alpha matting foreground threshold (default: 240)\n- `ab` - Alpha matting background threshold (default: 10)\n- `ae` - Alpha matting erosion size (default: 10)\n- `az` - Alpha matting base size (default: 1000)\n- `model` - Model choice: `u2net`, `u2netp`, or `u2net_human_seg`\n\n## Video\n\n### remove background from video and make transparent mov\n\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -tv -o \"output.mov\"\n```\n### Process all videos in a folder\n\nYou can now remove backgrounds from all supported image or video files in a folder using the `--input-folder` (`-if`) option. You can also optionally set an output folder using `--output-folder` (`-of`). If `--output-folder` is not provided, the outputs will be saved in the same input folder, prefixed with `output_`.\n\n### Example: Folder of Videos to Transparent `.mov`\n\n```bash\nbackgroundremover -if \"\u002Fpath\u002Fto\u002Fvideo-folder\" -of \"\u002Fpath\u002Fto\u002Foutput-folder\" -tv\n```\n\nYou can also combine additional options:\n\n```bash\nbackgroundremover -if \"videos\" -of \"processed\" -m \"u2net_human_seg\" -fr 30 -tv\n```\n\n- Uses the `u2net_human_seg` model\n- Overrides video framerate to 30 fps\n- Outputs transparent `.mov` files into the `processed\u002F` folder\n- Supported video formats: `.mp4`, `.mov`, `.webm`, `.ogg`, `.gif`\n- Output files will be named like `output_filename.ext` in the output folder\n\n### remove background from local video and overlay it over other video\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -tov -bv \"\u002Fpath\u002Fto\u002Fbackground_video.mp4\" -o \"output.mov\"\n```\n### remove background from local video and overlay it over an image\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -toi -bi \"\u002Fpath\u002Fto\u002Fbackground_image.png\" -o \"output.mov\"\n```\n\n### remove background from video and make transparent gif\n\n\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -tg -o \"output.gif\"\n```\n### Make matte key file (green screen overlay)\n\nMake a matte file for premiere\n\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -mk -o \"output.matte.mp4\"\n```\n\n### Video Playback and Compatibility\n\n**Important:** Transparent `.mov` outputs default to ProRes 4444 (`prores_ks` with `yuva444p10le`) which provides 10-bit color with alpha channel and excellent compatibility with professional video editors (DaVinci Resolve, Premiere, Final Cut Pro). You can switch codecs with `--alpha-codec` if needed.\n\nExamples:\n```bash\n# Smaller WebM with alpha (if your tools support it)\nbackgroundremover -i \"video.mp4\" -tv --alpha-codec libvpx-vp9 -o \"output.webm\"\n\n# Legacy qtrle codec (lossless but very large files)\nbackgroundremover -i \"video.mp4\" -tv --alpha-codec qtrle -o \"output.mov\"\n```\n\n**Recommended video players:**\n- **mpv** (https:\u002F\u002Fmpv.io) - Best support for transparent videos (Linux, Mac, Windows)\n- **QuickTime Player** (Mac) - Native support on macOS\n- **DaVinci Resolve** \u002F **Adobe Premiere** - Full support in video editors (may need to enable alpha channel in properties)\n\n**Common issues:**\n- **VLC**: May not display transparency correctly - shows distorted colors or green\u002Fpurple tint\n- **Windows Media Player**: Limited transparency support\n- **Web browsers**: Limited support for ProRes codec\n\n**Workarounds if your player doesn't support transparency:**\n\n1. **Convert to WebM with VP9 (better compatibility):**\n   ```bash\n   ffmpeg -i output.mov -c:v libvpx-vp9 -pix_fmt yuva420p output.webm\n   ```\n\n2. **Add a colored background (for testing):**\n   ```bash\n   ffmpeg -f lavfi -i color=white:s=1920x1080 -i output.mov -filter_complex 'overlay=0:0' -c:v libx264 output_with_bg.mp4\n   ```\n\n3. **Use the transparent GIF output instead** (simpler but lower quality):\n   ```bash\n   backgroundremover -i \"video.mp4\" -tg -o \"output.gif\"\n   ```\n\n### Advance usage for video\n\nChange the framerate of the video (default is set to 30)\n\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -fr 30 -tv -o \"output.mov\"\n```\n\nSet total number of frames of the video (default is set to -1, ie the remove background from full video)\n\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -fl 150 -tv -o \"output.mov\"\n```\n\nChange the gpu batch size of the video (default is set to 1)\n\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -gb 4 -tv -o \"output.mov\"\n```\n\nChange the number of workers working on video (default is set to 1)\n\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -wn 4 -tv -o \"output.mov\"\n```\n\n**Note:** Using high worker counts (>4) may cause `ConnectionResetError` or crashes on some systems due to multiprocessing limitations. If you experience errors, reduce the number of workers or use `-wn 1`. The optimal number depends on your CPU cores and available RAM.\nchange the model for different background removal methods between `u2netp`, `u2net`, or `u2net_human_seg` and limit the frames to 150\n```bash\nbackgroundremover -i \"\u002Fpath\u002Fto\u002Fvideo.mp4\" -m \"u2net_human_seg\" -fl 150 -tv -o \"output.mov\"\n```\n\n## As a library\n### Remove background image\n\n```python\nfrom backgroundremover.bg import remove\n\ndef remove_bg(src_img_path, out_img_path):\n    model_choices = [\"u2net\", \"u2net_human_seg\", \"u2netp\"]\n    f = open(src_img_path, \"rb\")\n    data = f.read()\n    img = remove(data, model_name=model_choices[0],\n                 alpha_matting=True,\n                 alpha_matting_foreground_threshold=240,\n                 alpha_matting_background_threshold=10,\n                 alpha_matting_erode_structure_size=10,\n                 alpha_matting_base_size=1000)\n    f.close()\n    f = open(out_img_path, \"wb\")\n    f.write(img)\n    f.close()\n```\n\n### Generate only a binary mask\n\n```python\nfrom backgroundremover.bg import remove\n\nf = open(\"input.jpg\", \"rb\")\ndata = f.read()\nmask = remove(data, model_name=\"u2net\", only_mask=True)\nf.close()\n\nf = open(\"mask.png\", \"wb\")\nf.write(mask)\nf.close()\n```\n\n### Replace background with custom color\n\n```python\nfrom backgroundremover.bg import remove\n\nf = open(\"input.jpg\", \"rb\")\ndata = f.read()\n# Use RGB tuple for background color (255, 0, 0) = red\nimg = remove(data, model_name=\"u2net\", background_color=(255, 0, 0))\nf.close()\n\nf = open(\"output.png\", \"wb\")\nf.write(img)\nf.close()\n```\n\n### Replace background with custom image\n\n```python\nfrom backgroundremover.bg import remove\n\n# Read input image\nwith open(\"input.jpg\", \"rb\") as f:\n    input_data = f.read()\n\n# Read background image\nwith open(\"background.jpg\", \"rb\") as f:\n    bg_data = f.read()\n\n# Remove background and composite over background image\nresult = remove(input_data, model_name=\"u2net\", background_image=bg_data)\n\n# Save result\nwith open(\"output.png\", \"wb\") as f:\n    f.write(result)\n```\n\n## Troubleshooting\n\n### \"EOFError: Ran out of input\" or Model Loading Errors\n\nIf you see errors like `EOFError: Ran out of input` or model loading failures:\n\n**Cause:** The model file download was corrupted or interrupted.\n\n**Solution:**\n```bash\n# Delete the corrupted model file\nrm ~\u002F.u2net\u002Fu2net.pth\n# Or for other models:\nrm ~\u002F.u2net\u002Fu2netp.pth\nrm ~\u002F.u2net\u002Fu2net_human_seg.pth\n\n# Then run backgroundremover again - it will re-download the model\nbackgroundremover -i \"your-image.jpg\" -o \"output.png\"\n```\n\n**Prevention:** The tool now automatically validates and retries failed downloads, but if you have an old corrupted model from a previous version, you'll need to delete it manually.\n\n### Background Not Removed or Parts Missing\n\nIf the background is not being removed properly, or parts of your subject are disappearing:\n\n1. **Try a different model:**\n   - Use `u2net_human_seg` for people\u002Fportraits\n   - Use `u2net` (default) for general objects\n   - The model choice significantly affects results\n\n2. **Adjust alpha matting:**\n   - Enable with `-a` flag for better edge detection\n   - Adjust threshold values `-af` and `-ab` if parts are incorrectly classified\n\n3. **Check your input:**\n   - Ensure good lighting and contrast between subject and background\n   - Avoid backgrounds that are similar in color to your subject\n   - Consider manually cropping to include more recognizable background\n\n### Transparency Issues or Strange Colors\n\nIf the output video shows distorted colors, green\u002Fpurple tint, or transparency isn't working:\n\n1. **Check your video player** - See the \"Video Playback and Compatibility\" section above\n2. **Use a recommended player** like mpv or QuickTime Player\n3. **Convert to a different format** if needed (see WebM conversion examples)\n\n### Large Output File Sizes\n\nThe transparent `.mov` files use ProRes 4444 codec and will be larger than the input. ProRes 4444 provides much better compression than the previous qtrle codec while maintaining 10-bit color with alpha:\n\n- File sizes are significantly smaller than qtrle but still larger than standard video\n- This is expected for high-quality transparency preservation\n- Use `--alpha-codec libvpx-vp9` with `.webm` output for smaller files if your tools support it\n\n### Poor Quality or Inaccurate Results\n\nBackground removal quality depends on:\n\n1. **Input quality** - Higher resolution and better lighting improve results\n2. **Subject complexity** - Simple, well-defined subjects work best\n3. **Model limitations** - AI models may struggle with:\n   - Very similar colors between subject and background\n   - Complex hair\u002Ffur details\n   - Transparent or reflective objects\n   - Unusual subjects the model wasn't trained on\n\n**Tips for better results:**\n- Use `u2net_human_seg` specifically for human subjects\n- Enable alpha matting with `-a` for complex edges\n- Ensure good contrast between subject and background when capturing\n- Try different alpha matting parameters (`-ae`, `-af`, `-ab`)\n\n## Testing\n\nCurrently, this project does not have automated test cases. Testing is done manually using sample images and videos.\n\n### Manual Testing\n\nTo test backgroundremover functionality:\n\n**Test Image Background Removal:**\n```bash\n# Basic test\nbackgroundremover -i \"test_image.jpg\" -o \"output.png\"\n\n# Test with alpha matting\nbackgroundremover -i \"test_image.jpg\" -a -ae 15 -o \"output.png\"\n\n# Test mask generation\nbackgroundremover -i \"test_image.jpg\" -om -o \"mask.png\"\n\n# Test custom background color\nbackgroundremover -i \"test_image.jpg\" -bc \"0,255,0\" -o \"output.png\"\n```\n\n**Test Video Processing:**\n```bash\n# Test transparent video\nbackgroundremover -i \"test_video.mp4\" -tv -o \"output.mov\"\n\n# Test matte key\nbackgroundremover -i \"test_video.mp4\" -mk -o \"matte.mov\"\n\n# Test transparent GIF\nbackgroundremover -i \"test_video.mp4\" -tg -o \"output.gif\"\n```\n\n**Test HTTP Server:**\n```bash\n# Start server\nbackgroundremover-server --port 5000\n\n# Test with curl (in another terminal)\ncurl -X POST -F \"file=@test_image.jpg\" http:\u002F\u002Flocalhost:5000\u002F -o output.png\n```\n\n### Contributing Tests\n\nAutomated tests using pytest or unittest would be a valuable contribution to this project. Test cases should cover:\n- Image processing with different formats (JPG, PNG, HEIC)\n- Video processing with different codecs\n- CLI argument validation\n- HTTP API endpoints\n- Model loading and inference\n- Error handling\n\n## Todo\n\n### Completed\n- ✅ HTTP API server (use `backgroundremover-server`)\n- ✅ Comprehensive documentation and troubleshooting\n- ✅ Docker support with model persistence\n- ✅ HEIC\u002FHEIF image format support\n- ✅ Pipe support (stdin\u002Fstdout)\n- ✅ Custom background colors and images\n- ✅ Binary mask output\n- ✅ Folder batch processing\n\n### In Progress \u002F Future Features\n- Support for additional models (ISNet, BiRefNet, U2Net cloth segmentation)\n- CoreML support for Apple Silicon acceleration\n- Standalone executable (no Python installation required)\n- Automated test suite\n- Real-time background removal for video streaming\n- Convert logic from video to image to utilize more GPU on image removal\n- Ability to provide feedback on results to improve training datasets\n- Support for custom\u002Fuser-provided models\n- Google Colab notebook\n\nContributions welcome! See open issues for details.\n\n### Pull requests\n\nAccepted\n\n### If you like this library\n\nGive a link to our project [BackgroundRemoverAI.com](https:\u002F\u002Fbackgroundremoverai.com) or this git, telling people that you like it or use it.\n\n### Reason for project\n\nWe made it our own package after merging together parts of others, adding in a few features of our own via posting parts as bounty questions on superuser, etc.  As well as asked on hackernews earlier to open source the image part, so decided to add in video, and a bit more.\n\n\n\n### References\n\n- https:\u002F\u002Farxiv.org\u002Fpdf\u002F2005.09007.pdf\n- https:\u002F\u002Fgithub.com\u002FNathanUA\u002FU-2-Net\n- https:\u002F\u002Fgithub.com\u002Fpymatting\u002Fpymatting\n- https:\u002F\u002Fgithub.com\u002Fdanielgatis\u002Frembg\n- https:\u002F\u002Fgithub.com\u002Fecsplendid\u002Frembg-greenscreen\n- https:\u002F\u002Fsuperuser.com\u002Fquestions\u002F1647590\u002Fhave-ffmpeg-merge-a-matte-key-file-over-the-normal-video-file-removing-the-backg\n- https:\u002F\u002Fsuperuser.com\u002Fquestions\u002F1648680\u002Fffmpeg-alphamerge-two-videos-into-a-gif-with-transparent-background\u002F1649339?noredirect=1#comment2522687_1649339\n- https:\u002F\u002Fsuperuser.com\u002Fquestions\u002F1649817\u002Fffmpeg-overlay-a-video-after-alphamerging-two-others\u002F1649856#1649856\n\n### License\n\n- Copyright (c) 2021-present [Johnathan Nader](https:\u002F\u002Fgithub.com\u002Fnadermx)\n- Copyright (c) 2020-present [Lucas Nestler](https:\u002F\u002Fgithub.com\u002FClashLuke)\n- Copyright (c) 2020-present [Dr. Tim Scarfe](https:\u002F\u002Fgithub.com\u002Fecsplendid)\n- Copyright (c) 2020-present [Daniel Gatis](https:\u002F\u002Fgithub.com\u002Fdanielgatis)\n\nCode Licensed under [MIT License](.\u002FLICENSE.txt)\nModels Licensed under [Apache License 2.0](.\u002Fmodels\u002Flicense)\n","BackgroundRemover 是一个基于AI的命令行工具，用于从图像和视频中移除背景。它使用PyTorch框架支持深度学习模型，提供简洁的CLI界面，使得用户可以轻松地处理媒体文件。该工具支持Python 3.6及以上版本，并且需要安装FFmpeg来处理视频。其核心功能包括高效准确的背景移除算法，适用于照片编辑、视频制作等场景，尤其是当需要批量处理或自动化工作流时。开源且免费的特点使其成为个人开发者和小型团队的理想选择。",2,"2026-06-11 03:35:37","high_star"]