File size: 720 Bytes
0e353f2 |
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 |
FROM python:3.10-slim
WORKDIR /app
# System deps for Detectron2
RUN apt-get update && apt-get install -y \
git git-lfs ffmpeg libsm6 libxext6 libgl1 curl \
build-essential cmake ninja-build \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install
# PyTorch
RUN pip install --no-cache-dir torch==2.0.1 torchvision==0.15.2
# Detectron2 from source
RUN pip install --no-cache-dir git+https://github.com/facebookresearch/detectron2.git
# Other deps with fixed NumPy version
RUN pip install --no-cache-dir \
gradio>=4.0.0 \
opencv-python-headless \
"numpy<2" \
Pillow \
fvcore \
iopath \
pyyaml \
tqdm \
huggingface_hub
COPY . /app
EXPOSE 7860
CMD ["python", "app.py"] |