From bd890f111e2c24c9d463be5305ee2ba320e40182 Mon Sep 17 00:00:00 2001 From: perco Date: Tue, 2 Jun 2026 21:55:38 +0200 Subject: [PATCH] Fix ValueError: use 'is not None' for numpy array truthiness check 'if quad else None' raises ValueError on a numpy array with more than one element. Replace with 'if quad is not None else None'. Co-Authored-By: Claude Sonnet 4.6 --- app/watcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/watcher.py b/app/watcher.py index cf145ba..dc2a830 100644 --- a/app/watcher.py +++ b/app/watcher.py @@ -221,7 +221,7 @@ def _process_clip(event_id: str, event_dir: str, clip_path: str, camera_name: st x1, y1, x2, y2, _ = plates[0] quad = _analyzer._find_plate_quad(best_frame, int(x1), int(y1), int(x2), int(y2)) plate_bbox = (int(x1), int(y1), int(x2), int(y2)) - plate_corrected = _analyzer._perspective_correct(best_frame, quad) if quad else None + plate_corrected = _analyzer._perspective_correct(best_frame, quad) if quad is not None else None else: log.info("PlateRecognizer returned no result, falling back to local LPR") if _analyzer: