Spaces:
Runtime error
Runtime error
|
Download README.md from npisb/pipecountapp-dev: direct link, hf CLI and curl.
- Browser
- Download file 2.12 kB
-
https://huggingface.co/spaces/npisb/pipecountapp-dev/resolve/main/README.md
- Command line
-
hf download hf://spaces/npisb/pipecountapp-dev/README.md
-
curl -L -o README.md https://huggingface.co/spaces/npisb/pipecountapp-dev/resolve/main/README.md
2.12 kB
| title: Pipe Count Dev | |
| emoji: π§ | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: docker | |
| app_port: 7860 | |
| pinned: false | |
| # Pipe Counting PWA (Offline-First) | |
| Modern offline-first PWA for counting pipes with **in-browser ONNX inference**, diameter clustering, and interactive correction. | |
| ## Features | |
| - **Offline inference** β YOLOv5 model runs in the browser via ONNX Runtime Web (WebGPU / WASM) | |
| - **Multi-diameter sorting** β clusters pipes by bounding-box size (no retraining) | |
| - **Interactive correction** β add, delete, re-tag, and area-select pipes | |
| - **Expected vs counted QA** β optional per-group expected quantity | |
| - **Export** β annotated PNG, JSON, CSV (client-side) | |
| - **Bilingual** β Thai / English UI | |
| - **Fast deploy** β tiny Docker image (no PyTorch at runtime) | |
| ## Architecture | |
| ``` | |
| Browser PWA β ONNX Runtime Web β YOLOv5 countmodel.onnx | |
| β | |
| Diameter clustering + user corrections + export | |
| β | |
| HF Space serves static files only (main.py) | |
| ``` | |
| ## Local development | |
| ### Frontend only | |
| ```bash | |
| cd frontend | |
| npm install | |
| npm run dev | |
| ``` | |
| ### Full stack (built PWA + API) | |
| ```bash | |
| cd frontend && npm run build | |
| # copy dist + models to static/ | |
| cd .. | |
| pip install -r requirements-server.txt | |
| uvicorn main:app --host 0.0.0.0 --port 7860 | |
| ``` | |
| ### Export ONNX model (one-time / CI) | |
| ```bash | |
| pip install -r requirements-export.txt | |
| pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu | |
| git clone --depth 1 https://github.com/ultralytics/yolov5.git | |
| python scripts/export_onnx.py | |
| ``` | |
| ## API Endpoints | |
| | Endpoint | Method | Description | | |
| |----------|--------|-------------| | |
| | `/` | GET | PWA shell | | |
| | `/health` | GET | Health check | | |
| ## Hugging Face Spaces | |
| - SDK: Docker | |
| - Port: 7860 | |
| - Hardware: Free CPU is sufficient (inference runs on client devices) | |
| - Build uses multi-stage Dockerfile: export ONNX β build PWA β serve static | |
| ## Configuration | |
| | Variable | Default | Description | | |
| |----------|---------|-------------| | |
| | (none required) | β | Inference is client-side | | |
| Legacy server inference endpoints (`/detectImage`, `/detect/json`) were removed in v1.0.0. | |