Files
aimsight-labeling/auto/revue-croisee/2026-11-04/obstruction/outils/images_citees.py
T
maximeandClaude Opus 5.5 14ad6ea3f9 Auto labels reviewed per station and cross-reviewed; all labeling knowledge in labeling/ (D-130)
- Every station's auto labels reviewed by an analyst (/review-auto-labels), then a
  cross-review per family across all stations (new skill /cross-review-labels),
  a finishing pass, and descriptions rewritten in words (no numeric values).
- The three never-labeled ranges (WILDSTRUBEL 07/09-01/10, NORDEND 16/08-01/10)
  labeled and reviewed: 991 auto labels on 11 stations, labeling/controle.py at 0 errors.
- Labeling knowledge gathered in labeling/: regles-d-etiquetage.md (new), familles.md
  (settled boundaries), connaissances/ (notes moved from docs/, links updated),
  the label map rebuilt from reviewed labels, events and cases; events tied to their
  stations (PS_DES_COUDRES is JUNGFRAU). The labeler and reviewers read only labeling/.
- labels-map reads auto labels and events; decision D-130; living plan points 73-75.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:21:57 +01:00

19 lines
1.4 KiB
Python

"""Pour chaque étiquette Obstruction : les heures d'image citées (« image(s)/vignette(s) de HH:MM ») existent-elles
dans data/<STATION>/images/ un jour de la plage (ou la veille, le lendemain) ? Et les phrases « pas d'image » sont-elles vraies ?"""
import json, os, re
from datetime import datetime, timedelta
def t(s): return datetime.fromisoformat(s.replace('Z', '+00:00'))
for st in ['BREITHORN', 'CLARIDEN', 'FLORIDA', 'JUNGFRAU', 'LENZSPITZE', 'NIEDERHORN', 'NORDEND', 'SNCF01', 'WILDSTRUBEL']:
imgs = {f[:13] for f in os.listdir(f'data/{st}/images')} # AAAAMMJJTHHMM
for n, l in enumerate(open(f'labeling/auto/{st}.jsonl'), 1):
e = json.loads(l)
if e['categorie'] != 'Obstruction': continue
d0, d1 = t(e['debut']), t(e['fin'])
jours = {(d0 + timedelta(days=k)).strftime('%Y%m%d') for k in range(-1, (d1 - d0).days + 2)}
heures = re.findall(r'(?:image|vignette)s?[^.;:]*? de (\d{2}):(\d{2})', e['description'])
manque = [f'{h}:{m}' for h, m in heures if not any(f'{j}T{h}{m}' in imgs for j in jours)]
pas = re.search(r"(pas d'image|aucune image)", e['description'], re.I)
dedans = sorted(i for i in imgs if d0.strftime('%Y%m%dT%H%M') <= i <= d1.strftime('%Y%m%dT%H%M'))
if manque or (pas and dedans):
print(f'{st}#{n}', e['debut'], e['fin'], 'citées absentes:', manque, '| dit pas d\'image, images dans la plage:' if pas else '', dedans if pas else '')