Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2024-04-17 - YOLO Stdout Blocking Overhead

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix journal entry date to match this change.

The heading date (2024-04-17) appears inconsistent with this PR’s timestamp (2026-04-17). Please update it to avoid stale/change-history confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.jules/bolt.md at line 1, Update the journal heading "## 2024-04-17 - YOLO
Stdout Blocking Overhead" to use the correct PR timestamp year by changing the
date to "2026-04-17" so the entry matches this change and avoids stale history.

**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.
2 changes: 2 additions & 0 deletions commonforms/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand All @@ -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 = {}
Expand Down