Spaces:
Runtime error
Runtime error
File size: 1,364 Bytes
82a8552 9021e76 76ce55e 9021e76 43761d7 699e27b cb0dba9 699e27b 43761d7 0ce14f6 84f1e4c 9021e76 0ce14f6 84f1e4c 43761d7 ff76b37 84f1e4c 43761d7 13da334 43761d7 76ce55e 84f1e4c 43761d7 aaee31d 9021e76 aaee31d 4e8dc69 5775ce0 76c7b4d a514f12 84f1e4c | 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 | # Torch 1.10 (cu111) + Detectron2 0.6 on CUDA 11.1
FROM nvidia/cuda:11.1.1-cudnn8-runtime-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1
# Minimal runtime deps (+ glib for cv2 + libGL)
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-pip git wget ca-certificates libglib2.0-0 libgl1 \
&& rm -rf /var/lib/apt/lists/*
# Pip tooling
RUN python3 -m pip install --upgrade pip setuptools==59.5.0 wheel
# Force headless OpenCV (no libGL/gtk needed)
RUN python3 -m pip install --no-cache-dir "opencv-python-headless==4.8.1.78" && \
python3 -m pip uninstall -y opencv-python opencv-contrib-python || true
# Pillow pin
RUN python3 -m pip install --no-cache-dir "pillow==9.5.0"
# Torch/cu111 + detectron2 0.6
RUN python3 -m pip install --no-cache-dir \
--extra-index-url https://download.pytorch.org/whl/cu111 \
torch==1.10.0+cu111 torchvision==0.11.1+cu111
RUN python3 -m pip install --no-cache-dir -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.10/index.html \
detectron2==0.6
# Geo + UI + detectree2
RUN python3 -m pip install --no-cache-dir \
gradio==4.* rasterio geopandas shapely matplotlib \
"git+https://github.com/PatBall1/detectree2.git"
WORKDIR /app
COPY app.py /app/app.py
# Copy pre-uploaded model(s)
COPY weights /weights
CMD ["python3", "app.py"]
|