Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ runs/*
*.pt
__pycache__/
__pycache__/*

# Local dependency-verification artifact (CPU freeze); not for the repo
.verified-freeze-cpu.txt
25 changes: 16 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# no-code-deeplearning-prod/Dockerfile

# Use NVIDIA's official CUDA base image
FROM nvidia/cuda:12.8.1-cudnn-runtime-ubuntu22.04
# NVIDIA CUDA base. Ubuntu 24.04 ships Python 3.12, which the pinned stack in
# requirements.txt requires (numpy 2.4 / pandas 3.0 need Python >= 3.11).
FROM nvidia/cuda:12.8.1-cudnn-runtime-ubuntu24.04

ENV DEBIAN_FRONTEND=noninteractive

# Install Python 3.10 and pip
# Python 3.12 + the OpenCV/rendering shared libs pulled in by opencv/albumentations.
RUN apt-get update && \
apt-get install -y \
python3.10 \
python3.12 \
python3.12-venv \
python3-pip \
libgl1 \
libglib2.0-0 \
Expand All @@ -18,16 +20,21 @@ RUN apt-get update && \
libfontconfig1 \
&& rm -rf /var/lib/apt/lists/*

RUN ln -sf /usr/bin/python3.10 /usr/bin/python && \
ln -sf /usr/bin/pip3 /usr/bin/pip
# Use an isolated virtualenv. On Ubuntu 24.04 the system Python is
# externally-managed (PEP 668), so installing into it needs a venv (or
# --break-system-packages); a venv is cleaner and keeps the image reproducible.
RUN python3.12 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

WORKDIR /app

# Copy requirements first for layer caching
COPY requirements.txt .

# Install Python dependencies (with CUDA torch)
RUN pip install --no-cache-dir -r requirements.txt
# Install the pinned dependencies. On this CUDA base image, PyPI serves the
# CUDA build of the pinned torch version.
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt

# Copy the entire DL service codebase
COPY . .
COPY . .
74 changes: 44 additions & 30 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
# Pinned to a verified-working stack.
#
# Every version below was confirmed by running the full train -> evaluate ->
# save -> inference cycle for all three tasks and both model families per task
# (image classification, object detection via DETR and YOLO, semantic
# segmentation via SegFormer and SMP U-Net) on Python 3.12 / CPU torch.
#
# Torch is pinned by version only (no +cpu local tag): on the CUDA base image in
# the Dockerfile, PyPI serves the matching CUDA build of the same version.
#
# To refresh: bump a pin, re-run the smoke tests for all tasks, then commit.

# --- Core ML/DL ---
torch
torchvision
torchaudio
accelerate
torch==2.13.0
torchvision==0.28.0
torchaudio==2.11.0
accelerate==1.14.0

# --- Hugging Face ---
transformers
datasets
evaluate
huggingface_hub
transformers==5.13.1
datasets==5.0.0
evaluate==0.4.6
huggingface_hub==1.23.0

# --- Task-Specific ---
albumentations
torchmetrics
timm
pycocotools
ultralytics
faster-coco-eval
segmentation-models-pytorch
albumentations==2.0.8
torchmetrics==1.9.0
timm==1.0.28
pycocotools==2.0.11
ultralytics==8.4.92
faster-coco-eval==1.7.2
segmentation-models-pytorch==0.5.0

# --- API & UI ---
fastapi
uvicorn[standard]
python-multipart
gradio
# --- API ---
fastapi==0.139.0
uvicorn[standard]==0.51.0
python-multipart==0.0.32

# --- Utilities ---
numpy
pandas
scipy
Pillow
wandb
psutil
scikit-learn
numpy==2.4.4
pandas==3.0.3
scipy==1.18.0
Pillow==12.2.0
psutil==7.2.2
scikit-learn==1.9.0

# --- Job Persistence & Queuing ---
sqlalchemy
celery
redis
sqlalchemy==2.0.51
celery==5.6.3
redis==8.0.1

# Removed (2026-07): gradio and wandb — neither is imported anywhere in the
# codebase (training sets WANDB_DISABLED=true), and gradio pulls a large,
# unused dependency tree. Re-add with a pin if a demo UI / W&B logging is built.