Upgrade rembg to use BiRefNet model (state-of-the-art)
- Use onnxruntime>=1.17.0 (fixed executable stack issues, no execstack needed) - Use rembg>=2.0.70 with BiRefNet model support - Update all remove-background endpoints to use birefnet-general model - BiRefNet provides better edge detection and matting quality than u2net - Falls back to default model if BiRefNet unavailable
This commit is contained in:
+3
-3
@@ -22,6 +22,7 @@ FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies for OpenCV, rembg, SAM, and image processing
|
||||
# Note: onnxruntime 1.17+ fixed executable stack issues, no longer need execstack
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libgl1 \
|
||||
libglib2.0-0 \
|
||||
@@ -37,9 +38,8 @@ RUN apt-get update && apt-get install -y \
|
||||
COPY backend/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Try to pre-download rembg model, but don't fail build if onnxruntime has issues
|
||||
# (onnxruntime can have executable stack issues in some Docker environments)
|
||||
# If this fails, Remove Background feature will be disabled
|
||||
# Verify rembg loads correctly (model downloads on first use)
|
||||
# rembg now supports BiRefNet models which are state-of-the-art for background removal
|
||||
RUN python -c "from rembg import remove; print('rembg ready')" || echo "WARNING: rembg not available - Remove Background will be disabled"
|
||||
|
||||
# Copy backend application
|
||||
|
||||
Reference in New Issue
Block a user