dep bump + frozen install

This commit is contained in:
Michael Pilosov 2026-05-16 18:17:15 -06:00
parent 1ab49bce1d
commit 802ee4b857
6 changed files with 1853 additions and 11 deletions

View File

@ -11,3 +11,4 @@ output*
.python-version
Makefile
docker-compose.yml
build

View File

@ -1,5 +1,5 @@
# BiRefNet background removal service — CUDA 12.4 runtime image.
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
# BiRefNet background removal service — CUDA 12.6 runtime image.
FROM nvidia/cuda:12.6.1-cudnn-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
@ -21,10 +21,10 @@ WORKDIR /app
# Install Python + dependencies first so this layer is cached across code changes.
# The BuildKit cache mount keeps the uv download cache warm across rebuilds.
COPY pyproject.toml ./
COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv python install 3.12 \
&& uv sync --no-install-project --no-dev
&& uv sync --no-install-project --no-dev --frozen
# Application code.
COPY src ./src

12
build/Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM python:3.13-slim
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
HF_HOME=/app/hf_cache \
HF_HUB_ENABLE_HF_TRANSFER=1 \
PORT=8000
RUN pip install rmbg-as-a-service hf-transfer
EXPOSE 8000
CMD ["rmbg-as-a-service"]

191
build/requirements.txt Normal file
View File

@ -0,0 +1,191 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml -o build/requirements.txt
annotated-doc==0.0.4
# via fastapi
annotated-types==0.7.0
# via pydantic
anyio==4.13.0
# via
# starlette
# watchfiles
certifi==2026.4.22
# via requests
charset-normalizer==3.4.7
# via requests
click==8.3.3
# via uvicorn
cuda-bindings==12.9.6
# via torch
cuda-pathfinder==1.5.4
# via cuda-bindings
cuda-toolkit==12.6.3
# via torch
einops==0.8.2
# via rmbg-as-a-service (pyproject.toml)
fastapi==0.136.1
# via litserve
filelock==3.29.0
# via
# huggingface-hub
# torch
# transformers
fsspec==2026.4.0
# via
# huggingface-hub
# torch
h11==0.16.0
# via uvicorn
hf-xet==1.5.0
# via huggingface-hub
httptools==0.7.1
# via uvicorn
huggingface-hub==0.36.2
# via
# timm
# tokenizers
# transformers
idna==3.15
# via
# anyio
# requests
jinja2==3.1.6
# via torch
kornia==0.8.2
# via rmbg-as-a-service (pyproject.toml)
kornia-rs==0.1.11
# via kornia
litserve==0.2.17
# via rmbg-as-a-service (pyproject.toml)
markupsafe==3.0.3
# via jinja2
mpmath==1.3.0
# via sympy
networkx==3.6.1
# via torch
numpy==2.4.5
# via
# rmbg-as-a-service (pyproject.toml)
# torchvision
# transformers
nvidia-cublas-cu12==12.6.4.1
# via
# cuda-toolkit
# nvidia-cudnn-cu12
# nvidia-cusolver-cu12
nvidia-cuda-cupti-cu12==12.6.80
# via cuda-toolkit
nvidia-cuda-nvrtc-cu12==12.6.85
# via cuda-toolkit
nvidia-cuda-runtime-cu12==12.6.77
# via cuda-toolkit
nvidia-cudnn-cu12==9.10.2.21
# via torch
nvidia-cufft-cu12==11.3.0.4
# via cuda-toolkit
nvidia-cufile-cu12==1.11.1.6
# via cuda-toolkit
nvidia-curand-cu12==10.3.7.77
# via cuda-toolkit
nvidia-cusolver-cu12==11.7.1.2
# via cuda-toolkit
nvidia-cusparse-cu12==12.5.4.2
# via
# cuda-toolkit
# nvidia-cusolver-cu12
nvidia-cusparselt-cu12==0.7.1
# via torch
nvidia-nccl-cu12==2.28.9
# via torch
nvidia-nvjitlink-cu12==12.6.85
# via
# cuda-toolkit
# nvidia-cufft-cu12
# nvidia-cusolver-cu12
# nvidia-cusparse-cu12
nvidia-nvshmem-cu12==3.4.5
# via torch
nvidia-nvtx-cu12==12.6.77
# via cuda-toolkit
packaging==26.2
# via
# huggingface-hub
# kornia
# transformers
pillow==12.2.0
# via
# rmbg-as-a-service (pyproject.toml)
# torchvision
pydantic==2.13.4
# via fastapi
pydantic-core==2.46.4
# via pydantic
python-dotenv==1.2.2
# via uvicorn
pyyaml==6.0.3
# via
# huggingface-hub
# timm
# transformers
# uvicorn
pyzmq==27.1.0
# via litserve
regex==2026.5.9
# via transformers
requests==2.34.2
# via
# huggingface-hub
# transformers
safetensors==0.7.0
# via
# timm
# transformers
setuptools==81.0.0
# via torch
starlette==1.0.0
# via fastapi
sympy==1.14.0
# via torch
timm==1.0.27
# via rmbg-as-a-service (pyproject.toml)
tokenizers==0.22.2
# via transformers
torch==2.11.0+cu126
# via
# rmbg-as-a-service (pyproject.toml)
# kornia
# timm
# torchvision
torchvision==0.26.0+cu126
# via
# rmbg-as-a-service (pyproject.toml)
# timm
tqdm==4.67.3
# via
# huggingface-hub
# transformers
transformers==4.57.6
# via rmbg-as-a-service (pyproject.toml)
triton==3.6.0
# via torch
typing-extensions==4.15.0
# via
# fastapi
# huggingface-hub
# pydantic
# pydantic-core
# torch
# typing-inspection
typing-inspection==0.4.2
# via
# fastapi
# pydantic
urllib3==2.7.0
# via requests
uvicorn==0.47.0
# via litserve
uvloop==0.22.1
# via uvicorn
watchfiles==1.1.1
# via uvicorn
websockets==16.0
# via uvicorn

View File

@ -3,10 +3,10 @@ name = "rmbg-as-a-service"
version = "0.0.1"
description = "Background removal as a GPU-accelerated API"
readme = "README.md"
requires-python = ">=3.12,<3.13"
requires-python = ">=3.12"
dependencies = [
"torch==2.5.1",
"torchvision==0.20.1",
"torch==2.11.0",
"torchvision==0.26.0",
"transformers>=4.44,<5",
"timm>=1.0.0",
"einops>=0.8.0",
@ -31,13 +31,13 @@ packages = ["src/rmbg_as_a_service"]
# BiRefNet (torch) needs CUDA wheels; pull torch/torchvision from the PyTorch index.
[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
name = "pytorch-cu126"
url = "https://download.pytorch.org/whl/cu126"
explicit = true
[tool.uv.sources]
torch = { index = "pytorch-cu124" }
torchvision = { index = "pytorch-cu124" }
torch = { index = "pytorch-cu126" }
torchvision = { index = "pytorch-cu126" }
[tool.ruff]
line-length = 100

1638
uv.lock generated Normal file

File diff suppressed because it is too large Load Diff