From c9c83554e5e53d6fcb803f9881ec3438956c0bd2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 11:39:53 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Disable=20verbose=20output?= =?UTF-8?q?=20in=20YOLO=20predictions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added `verbose=False` to `model.predict()` calls in `extract_widgets` to prevent synchronous stdout blocking overhead during inference loops. Co-authored-by: kingkillery <200727508+kingkillery@users.noreply.github.com> --- .jules/bolt.md | 3 +++ commonforms/inference.py | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 .jules/bolt.md diff --git a/.jules/bolt.md b/.jules/bolt.md new file mode 100644 index 0000000..d8bc73c --- /dev/null +++ b/.jules/bolt.md @@ -0,0 +1,3 @@ +## 2024-05-24 - Ultralytics YOLO verbose Output Blocking +**Learning:** For performance optimization with Ultralytics YOLO models, `model.predict()` can have significant synchronous stdout blocking overhead during loops. +**Action:** Pass `verbose=False` to `model.predict()` to avoid synchronous stdout blocking overhead when processing multiple items or looping. diff --git a/commonforms/inference.py b/commonforms/inference.py index 527925f..d4741dd 100644 --- a/commonforms/inference.py +++ b/commonforms/inference.py @@ -117,6 +117,7 @@ def extract_widgets( """ if self.fast: # ONNX models are compiled with a fixed input size + # ⚡ Bolt optimization: pass verbose=False to avoid synchronous stdout blocking overhead results = [ self.model.predict( p.image, @@ -124,10 +125,12 @@ def extract_widgets( conf=confidence, augment=False, imgsz=ONNX_IMAGE_SIZE, + verbose=False, ) for p in pages ] else: + # ⚡ Bolt optimization: pass verbose=False to avoid synchronous stdout blocking overhead results = self.model.predict( [p.image for p in pages], iou=DEFAULT_IOU_THRESHOLD, @@ -135,6 +138,7 @@ def extract_widgets( augment=True, imgsz=image_size, device=self.device, + verbose=False, ) widgets = {}