Skip to content

Align official YOLO defaults and keep API stable#471

Merged
glenn-jocher merged 9 commits intomainfrom
fix/align-official-defaults
Apr 17, 2026
Merged

Align official YOLO defaults and keep API stable#471
glenn-jocher merged 9 commits intomainfrom
fix/align-official-defaults

Conversation

@glenn-jocher
Copy link
Copy Markdown
Member

@glenn-jocher glenn-jocher commented Apr 17, 2026

Summary

  • align the default confidence and IoU thresholds with upstream Ultralytics defaults everywhere (conf=0.25, iou=0.7) across Dart, Android, iOS, example state, and test expectations
  • keep the cleanup net-negative while restoring the public barrel exports that were dropped by the refactor, avoiding an accidental API regression
  • retain the broader simplification work in the diff while removing build-only noise from the final change set

Validation

  • flutter analyze
  • flutter test
  • flutter analyze (in example/)
  • flutter build apk --debug (in example/)
  • flutter build ios --simulator --no-codesign (in example/)
  • dart pub publish --dry-run

Notes

  • bun run knip is not available in this repo because there is no knip script in package.json.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

This PR releases ultralytics_yolo 0.3.0 with clearer default model selection, standardized Ultralytics threshold defaults, broad cleanup across Android/iOS/Flutter code, and improved docs/examples 📦✨

📊 Key Changes

  • Added YOLO.defaultOfficialModel() so apps can easily choose the recommended default official model without hardcoding an ID 🤖
  • Standardized default thresholds across the plugin to Ultralytics defaults:
    • confidenceThreshold = 0.25
    • iouThreshold = 0.7
      This change was applied in Flutter, Android, iOS, tests, docs, and examples 🎯
  • Updated README, Chinese docs, API docs, install guides, and model docs to reflect the new default-model flow and threshold values 📚
  • Bumped the package version from 0.2.0 to 0.3.0 and updated the changelog 🆕
  • Simplified and cleaned up platform code on Android and iOS by removing a large amount of debug logging and minor redundancies 🧹
  • Improved example apps:
    • better default model selection
    • cleaner single-image inference example
    • more typed result handling with YOLOResult
    • cleaner UI button APIs and naming 🛠️
  • Kept backward-compatibility shims for older helper APIs and wrapper widgets, while marking some as deprecated for future cleanup 🔁
  • Tightened GitHub release/publish workflows so only @glenn-jocher can trigger those jobs 🔒

🎯 Purpose & Impact

  • Makes getting started easier for new users by providing an explicit “default official model” entry point 🚀
  • Improves consistency across platforms, so Android, iOS, Flutter widgets, controllers, tests, and docs all behave the same way ✅
  • Aligns runtime defaults with official Ultralytics behavior, which can lead to more expected detection results out of the box 🎯
  • Reduces noise in native logs and simplifies internal code, which should make maintenance and debugging cleaner for contributors 🧽
  • Improves developer experience with clearer examples, cleaner exports, and more strongly typed result parsing 👨‍💻
  • Minimizes upgrade risk for existing apps by preserving compatibility layers even as the API is being cleaned up 🛡️
  • Strengthens release security by limiting publish and tag workflows to a single trusted maintainer 🔐

@UltralyticsAssistant UltralyticsAssistant added documentation Improvements or additions to documentation enhancement New feature or request fixed Bug has been resolved labels Apr 17, 2026
@UltralyticsAssistant
Copy link
Copy Markdown
Member

👋 Hello @glenn-jocher, thank you for submitting a ultralytics/yolo-flutter-app 🚀 PR! This is an automated message to help with review readiness—an engineer will assist shortly. Please review the checklist below to help ensure a smooth merge ✨

  • Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions.
  • Synchronize with Source: Confirm your PR is synchronized with the ultralytics/yolo-flutter-app main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
  • Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
  • Update Documentation: Update the relevant documentation for any new or modified features.
  • Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
  • Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR by writing "I have read the CLA Document and I sign the CLA" in a new message.
  • Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀

Copy link
Copy Markdown
Member

@UltralyticsAssistant UltralyticsAssistant left a comment

Choose a reason for hiding this comment

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

🔍 PR Review

Made with ❤️ by Ultralytics Actions

The default-threshold alignment and log cleanup look good overall, but there are two functional issues on iOS where OBB and segmentation still ignore runtime threshold updates, plus a couple of public API removals that conflict with the stated compatibility goal.

💬 Posted 4 inline comments

Comment thread ios/Classes/ObbDetector.swift Outdated
Comment thread ios/Classes/Segmenter.swift Outdated
Comment thread lib/config/channel_config.dart
Comment thread lib/widgets/yolo_controls.dart
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 25 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/widgets/yolo_controller.dart 59.18% 20 Missing ⚠️
lib/config/channel_config.dart 66.66% 3 Missing ⚠️
lib/yolo_view.dart 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@glenn-jocher
Copy link
Copy Markdown
Member Author

Addressed the review findings:

  • iOS OBB static-image inference now uses the predictor's current confidenceThreshold and iouThreshold instead of hardcoded literals
  • iOS segmentation static-image inference now uses the predictor's current confidenceThreshold and iouThreshold instead of hardcoded literals
  • restored ChannelConfig.validateMethodCall() and ChannelConfig.createStandardArgs() as deprecated compatibility shims
  • restored lib/widgets/yolo_controls.dart as a deprecated compatibility wrapper instead of deleting the library outright

Validation rerun:

  • flutter analyze
  • flutter test

@glenn-jocher
Copy link
Copy Markdown
Member Author

Follow-up pushed to make model onboarding simpler without adding more resolver complexity:

  • added YOLO.defaultOfficialModel() so apps can start from the default official Ultralytics model without hardcoding an ID
  • updated the example controller to use that helper instead of duplicating default-model selection logic
  • tightened the docs in README.md, README.zh-CN.md, and doc/models.md to show the two intended paths clearly: start with the default official model, or pass your own fine-tuned export

Validation rerun:

  • flutter analyze
  • flutter test

@glenn-jocher glenn-jocher merged commit cd0bb68 into main Apr 17, 2026
7 checks passed
@glenn-jocher glenn-jocher deleted the fix/align-official-defaults branch April 17, 2026 18:38
@UltralyticsAssistant
Copy link
Copy Markdown
Member

Huge congratulations on getting this merged, @glenn-jocher! 🎉

This is a thoughtful and impactful release for ultralytics_yolo 0.3.0 — from clearer default model selection with YOLO.defaultOfficialModel(), to consistent Ultralytics threshold defaults, cleaner native code, stronger examples, and tighter release security. It’s the kind of polish that makes the developer experience feel effortless.

“Simplicity is the ultimate sophistication.” — Leonardo da Vinci

That quote fits this PR beautifully: by making defaults clearer, behavior more consistent, and the codebase easier to maintain, you’ve made the plugin more approachable for every contributor and user who builds with it.

Thank you for the care, clarity, and long-term thinking behind this release — it’s a meaningful step forward for the Flutter ecosystem around Ultralytics. 🚀

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

Labels

documentation Improvements or additions to documentation enhancement New feature or request fixed Bug has been resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants