CoolFace
Apppublic

PUSHPENDAR/SHIP_FASTERRCNN

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
Dockerfile49 linesDownload Raw Back to root
1FROM python:3.10-slim2WORKDIR /app3ENV DEBIAN_FRONTEND=noninteractive4ENV TZ=UTC5ENV FORCE_CUDA=06ENV TORCH_CUDA_ARCH_LIST=""7ENV HF_HOME=/app/hf_cache8 9RUN apt-get update && apt-get install -y \10    git gcc g++ ninja-build cmake \11    libglib2.0-0 libsm6 libxext6 \12    libgl1 libgomp1 \13    python3-dev build-essential \14    && rm -rf /var/lib/apt/lists/*15 16# Pin numpy<2 before anything else17RUN pip install --no-cache-dir "numpy<2"18 19RUN pip install --no-cache-dir \20    torch==2.1.0+cpu \21    torchvision==0.16.0+cpu \22    --index-url https://download.pytorch.org/whl/cpu23 24RUN pip install --no-cache-dir \25    'git+https://github.com/facebookresearch/detectron2.git' \26    --no-build-isolation27 28# Upgrade Gradio to 4.x to fix the Jinja2 unhashable dict bug29# Pin Jinja2 explicitly to avoid future breakage30RUN pip install --no-cache-dir \31    "gradio>=4.44.1" \32    "huggingface_hub>=0.19.4" \33    "opencv-python-headless" \34    "Pillow>=9.0,<12.0" \35    "jinja2>=3.1.2,<4.0"36 37# Force numpy back to <2 in case any step above upgraded it38RUN pip install --no-cache-dir "numpy<2" --force-reinstall39 40RUN mkdir -p /app/hf_cache && \41    useradd -m -u 1000 user && \42    chown -R user:user /app43 44USER user45COPY --chown=user . /app46EXPOSE 786047 48# Fix: use the actual filename, not a markdown hyperlink49CMD ["python", "app.py"]