scaffold — FastAPI + SQLite + HTMX dashboard, ingest + dispatcher

- app/main.py : dashboard /, partials /partials/{jobs,monitor} (htmx polling)
- app/templates/ : index, jobs table, monitor card par worker
- app/static/style.css : thème sombre cohérent
- scripts/ingest.py : scan SSD d'acquisition, EXIF CreateDate → segments
  continus par (AUV, GoPro serial) avec seuil configurable
- scripts/dispatcher.py : polling queue, pick worker selon VRAM free,
  extraction ffmpeg + lingbot-map windowed --offload_to_cpu, progression DB
- DB : SQLite (acquisitions + jobs), lifecycle queued→extracting→running→done
- Workers par défaut : .87 (3060 12GB) + .84 (3090 24GB)

Contexte : QC terrain le jour-même (avant photogrammétrie à 30 jours),
plusieurs heures × 2 GoPros × 2-3 AUVs d'enregistrement à traiter en parallèle.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 09:52:41 +00:00
parent 17edbcbd8b
commit b7d957c806
9 changed files with 766 additions and 1 deletions

View File

@@ -1,3 +1,49 @@
# cosma-qc
COSMA post-acquisition QC pipeline: per-GoPro lingbot-map reconstruction, job queue, web dashboard
**COSMA post-acquisition QC pipeline** — reconstruction photogrammétrique
par GoPro (lingbot-map), queue de jobs distribués, dashboard web pour suivi
terrain le jour même.
## Objectif
Après une acquisition AUV (2 GoPros × 2-3 AUVs × heures d'enregistrement),
savoir rapidement si la couverture est complète avant de replier la mission —
sans attendre les 30 jours du traitement photogrammétrique complet.
## Pipeline
```
SSD plugged ─┐
├─▶ Ingestion ─▶ Frame extraction (per GoPro × segment)
│ │
│ ▼
│ Job queue (SQLite)
│ │
│ ┌──────────────┼──────────────┐
▼ ▼ ▼ ▼
Dashboard Worker .87 Worker .84 (scalable)
(FastAPI) (3060) (3090)
│ │ │
│ └─▶ PLY ◀──────┘
│ │
│ ▼
└──────── ICP stitch (Open3D) ─▶ viser viewer
```
## Stack
- **Backend** : FastAPI + SQLite
- **Frontend** : HTMX (UI réactive sans build JS)
- **Queue** : table SQLite + workers SSH-triggered
- **Monitoring** : polling `nvidia-smi` sur .87 / .84, `df` pour disque
- **Reconstruction** : lingbot-map (GCT-Stream windowed)
- **Stitch** : Open3D ICP
## Déploiement
- Service sur .82 (stable, Caddy pour URL propre)
- Workers : SSH vers .87 (3060 12 GB) et .84 (3090 24 GB)
## État
Scaffold en cours.