Skip to content

⚡ Bolt: Disable verbose YOLO stdout#25

Draft
kingkillery wants to merge 1 commit into
mainfrom
bolt-yolo-verbose-optimization-10446816844459380643
Draft

⚡ Bolt: Disable verbose YOLO stdout#25
kingkillery wants to merge 1 commit into
mainfrom
bolt-yolo-verbose-optimization-10446816844459380643

Conversation

@kingkillery
Copy link
Copy Markdown
Owner

@kingkillery kingkillery commented Apr 17, 2026

💡 What: Added verbose=False to Ultralytics YOLO model.predict() calls in commonforms/inference.py during extract_widgets. Also added a journal entry documenting the learning about YOLO stdout blocking overhead.

🎯 Why: Ultralytics YOLO models by default output verbose logging directly to stdout synchronously. When predict() is called iteratively in a loop (e.g., page by page in extract_widgets), this synchronous I/O blocks the main thread, introducing significant overhead and increasing execution time. Disabling verbose logging eliminates this bottleneck.

📊 Impact: Reduces inference time on the CPU. The exact savings vary by system and PDF length, but avoiding synchronous stdout I/O inside a loop leads to a measurable, reliable performance improvement without sacrificing readability or altering the model's actual predictions.

🔬 Measurement: Can be verified by running batched inference on a multi-page PDF with and without the patch. The overhead from stdout printing will no longer slow down execution. (Tested and verified improvement locally via synthetic benchmarks).


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

Summary by CodeRabbit

  • Bug Fixes

    • Improved inference performance by reducing logging output during prediction operations, eliminating slowdowns previously experienced in batch processing scenarios.
  • Documentation

    • Added documentation noting performance considerations for inference operations.

* 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>
@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 17, 2026

Walkthrough

The changes address a verbose logging performance issue in YOLO model inference by documenting the problem and suppressing stdout output in the inference pipeline. A documentation note describes the blocking behavior of synchronous verbose logging, and the detector's predict calls are updated to disable verbosity.

Changes

Cohort / File(s) Summary
Documentation
.jules/bolt.md
Added a performance note documenting that verbose stdout logging in Ultralytics YOLO model.predict() occurs synchronously, causing blocking overhead in looped inference. Specifies setting verbose=False as the operational solution.
Inference Pipeline
commonforms/inference.py
Added verbose=False parameter to model.predict() calls in FFDNetDetector.extract_widgets() across both fast (ONNX per-page loop) and non-fast (batched predict) inference paths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 Hop, hop! The YOLO now whispers quiet,
No verbose chatter in our inference diet,
Silent predictions, swift and serene,
Performance blooming like fresh carrots green! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: disabling verbose YOLO stdout logging by adding verbose=False to predict calls.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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-optimization-10446816844459380643

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 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.
🪄 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: c061f2bf-07ba-47cc-8f17-0ef5937a579e

📥 Commits

Reviewing files that changed from the base of the PR and between e00f2d1 and d922e70.

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

Comment thread .jules/bolt.md
@@ -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.

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