diff --git a/CLAUDE.md b/CLAUDE.md index a57cb81..489c4c3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,12 +19,12 @@ pytest tests/test_scenarios_regression.py -v # FSM pe imagini reale ## Calibration corpus -`calibration/` — persistent, auto-suficient, safe to keep când `samples/` și `logs/fires/` se golesc. Conține: -- `frames/` — PNG-uri `{ts}_{color}.png` (ground truth în nume) -- `calibration_labels.json` — gate offline pentru `atm validate-calibration` +`calibration/` — persistent, auto-suficient. Conține: +- `frames/` — PNG-uri raw `{ts}_{color}.png` scrise **automat** de live loop la fiecare schimbare de culoare (filename = culoarea detectată, poate fi greșită) +- `calibration_labels.json` — ground truth **manual** (gate offline pentru `atm validate-calibration`) - `scenarios.json` — secvențe FSM pentru `tests/test_scenarios_regression.py` -Când adaugi un frame: copiezi din `logs/fires/` → redenumești `{ts}_{color}.png` → adaugi entry în JSON. Validare după orice recalibrare. +Workflow după sesiune: review frame-urile noi din `frames/`, adaugi entry-uri în `calibration_labels.json` cu culoarea pe care ai văzut-o TU pe chart (nu neapărat cea din filename), rulezi `atm validate-calibration`. ## Telegram commands (live) diff --git a/calibration/frames/20260421_164210_gray.png b/calibration/frames/20260421_164210_gray.png new file mode 100644 index 0000000..3b1b051 Binary files /dev/null and b/calibration/frames/20260421_164210_gray.png differ diff --git a/calibration/frames/20260421_164452_gray.png b/calibration/frames/20260421_164452_gray.png new file mode 100644 index 0000000..5b2c5ff Binary files /dev/null and b/calibration/frames/20260421_164452_gray.png differ diff --git a/calibration/frames/20260421_165209_gray.png b/calibration/frames/20260421_165209_gray.png new file mode 100644 index 0000000..b4cede8 Binary files /dev/null and b/calibration/frames/20260421_165209_gray.png differ diff --git a/calibration/frames/20260421_170045_dark_green.png b/calibration/frames/20260421_170045_dark_green.png new file mode 100644 index 0000000..14b154b Binary files /dev/null and b/calibration/frames/20260421_170045_dark_green.png differ diff --git a/calibration/frames/20260421_174502_yellow.png b/calibration/frames/20260421_174502_yellow.png new file mode 100644 index 0000000..bba9ee9 Binary files /dev/null and b/calibration/frames/20260421_174502_yellow.png differ diff --git a/calibration/frames/20260421_174804_gray.png b/calibration/frames/20260421_174804_gray.png new file mode 100644 index 0000000..1b2bb65 Binary files /dev/null and b/calibration/frames/20260421_174804_gray.png differ diff --git a/calibration/frames/20260421_220346_dark_red.png b/calibration/frames/20260421_220346_dark_red.png new file mode 100644 index 0000000..52e2435 Binary files /dev/null and b/calibration/frames/20260421_220346_dark_red.png differ diff --git a/calibration/frames/20260421_222108_gray.png b/calibration/frames/20260421_222108_gray.png new file mode 100644 index 0000000..56e401d Binary files /dev/null and b/calibration/frames/20260421_222108_gray.png differ diff --git a/src/atm/main.py b/src/atm/main.py index 6e84be1..e32eb27 100644 --- a/src/atm/main.py +++ b/src/atm/main.py @@ -1382,8 +1382,12 @@ async def run_live_async(cfg, duration_s=None, capture_stub: bool = False) -> No start = time.monotonic() heartbeat_due = time.monotonic() + cfg.heartbeat_min * 60 - samples_dir = Path("samples") - samples_dir.mkdir(exist_ok=True) + # Dump raw frames direct în corpusul de calibrare — fără pas manual + # de copy-paste din samples/. calibration_labels.json rămâne manual + # (filename-ul folosește culoarea detectată, care poate fi greșită; + # curarea labels.json e ce face validate-calibration truthful). + samples_dir = Path("calibration") / "frames" + samples_dir.mkdir(parents=True, exist_ok=True) fires_dir = Path("logs") / "fires" fires_dir.mkdir(parents=True, exist_ok=True) try: @@ -1496,7 +1500,7 @@ def _build_capture(cfg, capture_stub: bool = False): if use_stub: import itertools - samples_dir = Path("samples") + samples_dir = Path("calibration") / "frames" pngs = sorted(samples_dir.glob("*.png")) if samples_dir.exists() else [] _cycle = itertools.cycle(pngs) if pngs else None