Unify Flutter model resolution around metadata#469
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
👋 Hello @glenn-jocher, thank you for submitting a
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! 🚀🙂 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Overall the metadata-first resolver refactor looks solid, but there are a few important issues to address before merging: a race in YOLOView can leave the widget on a stale model, cached downloads can get stuck on partial/corrupt files, and the new zip extraction path handling introduces a Zip Slip vulnerability for remote model archives.
💬 Posted 3 inline comments
|
Final hardening pass pushed in dd8a43e. This fixes the live review findings (atomic downloads, safe zip extraction, stale YOLOView resolution), replaces the generated official-model matrix with a small explicit per-platform catalog that matches the real release assets, and simplifies the example to only present official task/model combinations that actually exist on the running platform.\n\nRe-verified locally on this head with:\n- flutter analyze\n- flutter test\n- flutter build apk --debug (example/)\n- flutter build ios --simulator --no-codesign (example/)\n\nThis leaves the package closer to the intended DX: official IDs are truthful, custom model paths remain first-class, and users can drop in exported models without maintaining duplicate task/model state in the example. |
|
🎉 Huge thanks for getting this merged, @glenn-jocher — this is a fantastic step forward for the Flutter experience. As Leonardo da Vinci said, “Simplicity is the ultimate sophistication.” That fits this PR perfectly: simplifying model loading, enabling metadata-first task detection, and aligning everything around YOLO26 makes the package much more intuitive, reliable, and developer-friendly. Really appreciate the care behind both the implementation and the docs cleanup here. This kind of work makes the whole ecosystem easier to adopt and more polished for everyone building with Ultralytics. 🚀 |
Summary
taskoptional inYOLOandYOLOViewwhen exported metadata already provides itWhat changed
inspectModelhooks on Android and iOS for task/label metadatapredict()andYOLOViewseparate, but made them share the same resolver pathv0.2.0release URL with latest-release downloadsVerification
flutter analyzeflutter testflutter build apk --debuginexample/flutter build ios --simulator --no-codesigninexample/🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
WARNING⚠️ this PR is very large, summary may not cover all changes.
🌟 Summary
This PR makes YOLO Flutter model loading much simpler and smarter by adding package-level model resolution, automatic metadata-based task detection, and a major docs/example cleanup around official YOLO26-first workflows 🚀
📊 Key Changes
taskoptional in more places by resolving it from exported model metadata acrossYOLO,YOLOView, andYOLOViewController.switchModel()🧠inspectModelcapability on Android to read model metadata without fully loading the model 🔍🎯 Purpose & Impact