-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gpu
More file actions
55 lines (46 loc) · 1.95 KB
/
Copy pathDockerfile.gpu
File metadata and controls
55 lines (46 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# =====================================================================
# NemaSize — GPU image (slim, NVIDIA CUDA 12.1)
# Only files & deps used by run_pipeline.py are included.
# Requires on the HOST: NVIDIA GPU + driver + nvidia-container-toolkit.
# Run with: docker run --gpus all ...
#
# Build:
# docker build -f Dockerfile.gpu -t nemasize:gpu .
# =====================================================================
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
# --- System libs needed by OpenCV / scikit-image at runtime -----------
# procps provides `ps`, required by Nextflow for task process monitoring.
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
procps \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
YOLO_OFFLINE=True \
MPLCONFIGDIR=/tmp/mpl
WORKDIR /opt/nemasize
# --- Runtime-only Python deps (torch already in base image) -----------
# (Build context is the repo ROOT; this Dockerfile lives in docker/.)
COPY docker/requirements-runtime.txt ./requirements-runtime.txt
RUN pip install --no-cache-dir -r requirements-runtime.txt
# --- Copy ONLY the scripts the pipeline needs ------------------------
COPY source_code/run_pipeline.py ./
COPY source_code/detect_and_crop_rois.py ./
COPY source_code/skeletonize_worms.py ./
COPY source_code/visualize_predictions.py ./
COPY source_code/speed_meter.py ./
# --- Bake in model weights --------------------------------------------
COPY weights/detect.pt ./weights/detect.pt
COPY weights/seg.pt ./weights/seg.pt
ENV NEMASIZE_DETECT_MODEL=/opt/nemasize/weights/detect.pt \
NEMASIZE_SEG_MODEL=/opt/nemasize/weights/seg.pt
WORKDIR /data
ENTRYPOINT ["python", "/opt/nemasize/run_pipeline.py"]
CMD ["--help"]