From d922e70fbba89839a5c8ca6e42a0542a1c8329d6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:23:13 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Disable=20verbose=20YOLO=20?= =?UTF-8?q?stdout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added `verbose=False` to `model.predict` in `commonforms/inference.py` to prevent synchronous stdout blocking overhead during inference loops. * Added performance journal entry in `.jules/bolt.md`. Co-authored-by: kingkillery <200727508+kingkillery@users.noreply.github.com> --- .jules/bolt.md | 3 +++ commonforms/inference.py | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 .jules/bolt.md diff --git a/.jules/bolt.md b/.jules/bolt.md new file mode 100644 index 0000000..ecf1b82 --- /dev/null +++ b/.jules/bolt.md @@ -0,0 +1,3 @@ +## 2024-04-17 - YOLO Stdout Blocking Overhead +**Learning:** Ultralytics YOLO models output verbose logs to stdout synchronously during `model.predict()`, which introduces significant blocking overhead when called inside loops or multiple times. +**Action:** Always pass `verbose=False` to `model.predict()` when doing batched or loop-based inference to bypass this synchronous blocking and improve performance. diff --git a/commonforms/inference.py b/commonforms/inference.py index 527925f..1d805cd 100644 --- a/commonforms/inference.py +++ b/commonforms/inference.py @@ -124,6 +124,7 @@ def extract_widgets( conf=confidence, augment=False, imgsz=ONNX_IMAGE_SIZE, + verbose=False, # Optimization: avoid synchronous stdout blocking overhead during loops ) for p in pages ] @@ -135,6 +136,7 @@ def extract_widgets( augment=True, imgsz=image_size, device=self.device, + verbose=False, # Optimization: avoid synchronous stdout blocking overhead during loops ) widgets = {}