Skip to content

⚡ Bolt: Disable YOLO stdout blocking to improve loop performance#32

Draft
kingkillery wants to merge 1 commit into
mainfrom
bolt/yolo-verbose-false-10345560072841588656
Draft

⚡ Bolt: Disable YOLO stdout blocking to improve loop performance#32
kingkillery wants to merge 1 commit into
mainfrom
bolt/yolo-verbose-false-10345560072841588656

Conversation

@kingkillery
Copy link
Copy Markdown
Owner

@kingkillery kingkillery commented Apr 21, 2026

💡 What: Added verbose=False to Ultralytics YOLO model.predict() calls in commonforms/inference.py.

🎯 Why: By default, YOLO models output inference results to stdout synchronously. In an automated form processing pipeline looping over multiple pages or fields, this synchronous I/O blocking introduces noticeable overhead.

📊 Impact: Eliminates unnecessary console I/O, which speeds up the prediction loop, especially when processing multi-page documents or running in environments where stdout writes are slow.

🔬 Measurement: Run a large PDF processing task before and after this change and observe the time to completion, or profile the I/O waits during inference.


PR created automatically by Jules for task 10345560072841588656 started by @kingkillery

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved inference performance by reducing unnecessary logging overhead during model predictions.
  • Documentation

    • Added optimization guidance for production prediction pipelines.

Add `verbose=False` to `model.predict()` calls in `FFDNetDetector.extract_widgets` to prevent synchronous I/O blocking during loops.

Co-authored-by: kingkillery <200727508+kingkillery@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Walkthrough

A performance optimization pattern is documented and implemented across the inference codebase. A new documentation entry records that Ultralytics YOLO .predict() outputs synchronous progress logs by default, which can block production pipelines. The extract_widgets method is updated to pass verbose=False to suppress this logging in both fast and standard inference paths.

Changes

Cohort / File(s) Summary
Documentation
.julius/bolt.md
New learning entry documenting YOLO stdout blocking overhead and the solution of passing verbose=False to suppress logging.
Inference Implementation
commonforms/inference.py
Updated extract_widgets method to pass verbose=False parameter to self.model.predict() calls in both ONNX/fast and standard inference branches.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Hop hop, the logs now stay quiet and still,
No verbose output blocking our pipeline's will,
Performance blooms where the chatter once grew,
One tiny parameter—False through and through!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: adding verbose=False to YOLO predict calls to eliminate stdout blocking overhead and improve loop performance, which matches the changeset modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt/yolo-verbose-false-10345560072841588656

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.jules/bolt.md:
- Line 1: Update the doc header line "## 2024-05-18 - YOLO Stdout Blocking
Overhead" to the correct authoring date (e.g., "## 2026-04-21 - YOLO Stdout
Blocking Overhead") so the entry is chronologically accurate; locate that exact
header string in .jules/bolt.md and replace the date only, leaving the title
text unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 30e4b534-6fed-4e3a-b720-546aea3db952

📥 Commits

Reviewing files that changed from the base of the PR and between 85489d5 and f7fbe7f.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • commonforms/inference.py

Comment thread .jules/bolt.md
@@ -0,0 +1,3 @@
## 2024-05-18 - 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

Doc date appears incorrect.

The entry is dated 2024-05-18, but this PR was opened on 2026-04-21. Consider updating to the actual authoring date so the learning log stays chronologically meaningful.

📝 Proposed fix
-## 2024-05-18 - YOLO Stdout Blocking Overhead
+## 2026-04-21 - YOLO Stdout Blocking Overhead
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## 2024-05-18 - YOLO Stdout Blocking Overhead
## 2026-04-21 - YOLO Stdout Blocking Overhead
🤖 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 doc header line "## 2024-05-18 - YOLO
Stdout Blocking Overhead" to the correct authoring date (e.g., "## 2026-04-21 -
YOLO Stdout Blocking Overhead") so the entry is chronologically accurate; locate
that exact header string in .jules/bolt.md and replace the date only, leaving
the title text unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant