Spaces:
Runtime error
Runtime error
Khunndev
Cursor
Add inference post-processing: conf 0.6, IoU 0.35, box filter, and center merge.
190dbf0 Download Dockerfile from npisb/pipecountapp-dev: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/npisb/pipecountapp-dev/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/npisb/pipecountapp-dev/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/npisb/pipecountapp-dev/resolve/main/Dockerfile
1.09 kB
| # Build PWA and serve static (ONNX models pre-built in frontend/public/models) | |
| FROM node:20-alpine AS frontend-build | |
| WORKDIR /frontend | |
| COPY frontend/package.json frontend/package-lock.json* ./ | |
| RUN npm ci | |
| COPY frontend/ . | |
| RUN npm run build | |
| FROM python:3.10-slim | |
| LABEL maintainer="NPI Pipe Count" | |
| ENV PYTHONUNBUFFERED=1 | |
| WORKDIR /app | |
| # Native libs required by onnxruntime (libgomp1) and opencv-python-headless (libglib2.0-0) | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends libgomp1 libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements-server.txt . | |
| RUN pip install --no-cache-dir -r requirements-server.txt | |
| COPY main.py detect.py detect_limiter.py postprocess.py ./ | |
| COPY --from=frontend-build /frontend/dist ./static | |
| RUN useradd -m appuser && chown -R appuser:appuser /app | |
| USER appuser | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \ | |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |