danielgatis/rembg
43.1
Weak · 16 November 2026
4.1k
lines of production code
Python
primary language
5
measurements over time
What this system is
Features
Add manual page for the rembg CLI
Users can now access the rembg command-line interface documentation via the standard man page (man rembg). This new file provides an overview of the tool's purpose, its usage as both a CLI and a library, and details for the --version and --help options.
man · high confidence
New model sessions and session registration system
The rembg sessions module has been restructured to introduce a centralized registration system in \_\init\\_.py that automatically discovers and registers all available model sessions. This change adds support for several new models including BiRefNet variants (General, General-Lite, Portrait, DIS, HRSOD, COD, Massive), BRIA-RMBG 2.0, and Silueta, while also introducing custom session types (ben\_custom, dis\_custom, u2net\_custom) that allow users to load their own ONNX models. The base session class now includes improved GPU provider fallback warnings to alert users when GPU acceleration isn't available, and implements a new model storage structure under \~/.rembg/models/\<model\>/ with backward compatibility for legacy model locations.
rembg/sessions · high confidence
Removals
Removal of legacy CLI and server command modules
The legacy command-line interface (cli.py) and Flask-based server implementation (server.py) within the src/rembg/cmd package have been removed. This eliminates the previous methods for running background removal tasks via direct Python script execution or a standalone HTTP service, indicating a shift in how users interact with the tool's core functionality.
src/rembg/cmd · high confidence
Removal of legacy background removal implementation
The legacy background removal module (src/rembg/bg.py) and its associated package initializer (src/rembg/\_\init\\_.py) have been removed. This eliminates the previous implementation that relied on the u2net model for image processing, indicating a shift in the library's architecture or a cleanup of deprecated code paths.
src/rembg · high confidence
Removal of legacy u2net implementation
The legacy u2net module has been removed from the codebase. This change deletes the internal data loading, model definition, and detection logic previously located in src/rembg/u2net, including the Rescale, ToTensor, and RSU neural network components. Users relying on this specific internal implementation will no longer have access to these utilities.
src/rembg/u2net · high confidence
Behavioural changes
CLI commands restructured into a modular command package
The CLI interface has been refactored to organize commands into a dedicated \rembg/commands\ package. This change introduces a central registry in \\_\init\\_.py\ that imports and registers individual command modules (\b\_command\, \d\_command\, \i\_command\, \m\_command\, \p\_command\, \s\_command\), replacing the previous flat structure. This modularization supports specific command implementations, such as the new \m\_command\ for migrating model files from the legacy \\~/.u2net\ directory to the new per-model layout, and the \s\_command\ which now includes SSRF protections and a \--no-ui\ flag for the HTTP server.
rembg/commands · high confidence
Project migration to Poetry and modern packaging
The project has migrated its build system from setuptools (setup.py) to Poetry, introducing pyproject.toml and poetry.lock while removing legacy setup.py and setup.cfg. This change updates the default model to bria-rmbg, adds a dedicated USAGE.md guide, and introduces new Dockerfiles for CPU and NVIDIA GPU environments alongside a docker-compose configuration. Windows installation is now supported via Inno Setup installers for both CPU and GPU builds, and the CLI now includes a --no-ui flag to reduce idle CPU usage on the server.
(repo-wide) · high confidence
ViTMatte edge refinement and color decontamination for softer cutouts
Users can now achieve higher-quality background removal with finer edge details, particularly for hair and fur, by enabling the opt-in ViTMatte edge refinement (via the \-vm\ flag) and color decontamination. The new matting module uses a ViTMatte ONNX model to refine coarse masks into precise alpha mattes, recovering soft details that standard segmentation might miss. Additionally, the \decontaminate\_cutout\ function removes background color fringing from semi-transparent pixels, resulting in cleaner edges. The default model has also been updated to bria-rmbg.
rembg · high confidence
Test coverage
Added test coverage for new and modified features
Added comprehensive tests for several new capabilities and behavioral changes: color decontamination for soft edges (test\_decontaminate.py), ViTMatte edge refinement variants and trimap generation (test\_matting.py), the new per-model model storage layout and migration command (test\_migrate.py, test\_model\_home.py), GPU provider fallback warnings (test\_provider\_fallback.py), the expanded set of supported models including BiRefNet variants (test\_remove.py), SAM model allowlist and checksum pinning (test\_sam\_model\_allowlist.py), IPv6 transition address blocking in the SSRF guard (test\_ssrf\_ipv6\_transition.py), and the new WithoutBg session integration (test\_withoutbg.py).
tests · high confidence
Dependencies
Migration from requirements.txt to Poetry with optional dependency groups
The project has replaced the flat requirements.txt file with a pyproject.toml configuration managed by Poetry. This introduces optional dependency groups (extras) for CPU, GPU, ROCm, CLI, and dev environments, allowing users to install only the specific components they need (e.g., \pip install rembg\[gpu\]\). Core dependencies have been updated to newer versions (e.g., numpy ^2.3.0, pillow ^12.1.0), and the build system now uses poetry-core with dynamic versioning.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 42 → 43 (+1.2)
- Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 81 → 79 (-2.2)
- Architecture 97 → 96 (-1.1)
- Maturity 54 → 54 (+0.2)
- Readiness 32 → 32 (+0.0)
- Security 32 → 32 (+0.0)
- Performance 100 (new)
Resolved (3)
- Members sharing a duplicated core (15 members, 50+ identical tokens) (rembg/sessions/birefnet_cod.py)
- No ADRs found
- Off-boarding risk: anonymized user #1
New (4)
- FileTooLong: commands/s_command.py (rembg/commands/s_command.py)
- Members sharing a duplicated core (15 members, 50+ identical tokens) (rembg/sessions/birefnet_cod.py)
- No ADRs found (pyproject.toml)
- Off-boarding risk: anonymized user #1
Changes since last survey
- 3 commits — 3 feature/other, 0 fixes
By area
- (root) — 1 commit
- rembg/bg.py — 1 commit
- rembg/sessions — 1 commit
Notable commits
- change: Harden the HTTP server and raise vulnerable dependency floors (#866)
- change: Keep every mask when using putalpha with multi-mask models (#864)
- change: Resize the u2net_cloth_seg label map with nearest neighbour (#865)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
danielgatis/rembg was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 16 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 991927b77667946dab59c50df31f7d4640e80457 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.73+preprod-52de90b74216.