mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat: upgrade to BiRefNet SOTA background removal model
- Switch default model from U2-Net to BiRefNet (state-of-the-art) - Add 6 model options: BiRefNet, BiRefNet Lite, BiRefNet Portrait, BRIA RMBG, IS-Net, U2-Net - Add animated progress bar with stage indicators (loading model, analyzing, removing, refining edges) and elapsed timer - Add intuitive background color presets (Transparent, White, Black, Red, Green, Blue) as clickable buttons + custom color picker - Handle background color compositing in Python (PIL alpha composite) - Add checkerboard pattern to before/after slider for transparency - Pre-bake BiRefNet model (973MB) in Docker image for instant use
This commit is contained in:
+5
-3
@@ -71,10 +71,12 @@ RUN /opt/venv/bin/pip install --no-cache-dir --upgrade pip && \
|
||||
# This makes the Docker image fully self-contained — works offline
|
||||
RUN /opt/venv/bin/python3 -c "\
|
||||
from rembg import new_session; \
|
||||
print('Downloading u2net model...'); \
|
||||
print('Downloading BiRefNet model (SOTA)...'); \
|
||||
new_session('birefnet-general'); \
|
||||
print('Downloading u2net model (fallback)...'); \
|
||||
new_session('u2net'); \
|
||||
print('u2net model ready') \
|
||||
" 2>/dev/null || echo "WARNING: Could not pre-download u2net model"
|
||||
print('Background removal models ready') \
|
||||
" 2>/dev/null || echo "WARNING: Could not pre-download rembg models"
|
||||
|
||||
RUN /opt/venv/bin/python3 -c "\
|
||||
try: \
|
||||
|
||||
Reference in New Issue
Block a user