-
-
Notifications
You must be signed in to change notification settings - Fork 66
Add threshold configuration methods to YOLO and YOLOView classes #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add setNumItemsThreshold, setConfidenceThreshold, setIouThreshold methods - Add getter methods for current threshold values - Add setThresholds method for batch configuration - Update README.md with threshold configuration documentation - Resolves issue #149: Enable programmatic threshold configuration
👋 Hello @john-rocky, thank you for submitting a Please review the following checklist to ensure your contribution is ready for integration:
For more info, check out our Contributing Guide. Thank you again for contributing to Ultralytics! Your improvements for threshold configuration in the iOS app will help empower the community. 🚀🎉 |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@john-rocky It looks great. Thanks for the real quick action.
It's also limited at ObjectDetector class to 100.
If you can check the line number 67 and 128. For loops should be like this:
for i in 0..<results.count
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
- Simplified loadModel method by using a single handleResult closure - Fixed type signature to use BasePredictor instead of Predictor protocol - Reduced code duplication in task-specific predictor creation - Maintained full functionality while improving code readability
- Simplified getter methods to single-line returns in YOLOView - Used range containment check (0.0...1.0).contains() for validation - Maintained all functionality while reducing code verbosity
@glenn-jocher |
…d limit - Changed 'for i in 0..<100' to 'for i in 0..<min(results.count, self.numItemsThreshold)' - Removed unnecessary nested conditions since min() handles the comparison - More efficient loop that only iterates over actual results - Addresses code review feedback from @emresa37
@emresa37 Fixed. |
Address review feedback by removing placeholder comments in onAppear block
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Adds easy, programmatic control of detection thresholds across the iOS SDK, simplifies predictor loading, and streamlines visualization capture — with minor performance and code quality improvements. 🚀
📊 Key Changes
min(results.count, numItemsThreshold)
for cleaner, faster processing.YOLO
:setNumItemsThreshold
,setConfidenceThreshold
,setIouThreshold
, plussetThresholds(...)
and corresponding getters.YOLOView
gains matching threshold setters/getters that sync UI sliders and predictor values.YOLO
andYOLOView
/YOLOCamera
.YOLO.swift
refactored to a single completion handler for all tasks (detect/segment/pose/OBB/classify).YOLOCamera
model path resolution simplified; uses anassert
(debug-only) instead offatalError
.copyVisualizationLayer(...)
for masks, poses, and OBB overlays.🎯 Purpose & Impact
YOLO
andYOLOView
reduce boilerplate and potential errors.assert
avoids hard crashes during development if model paths are missing.