Skip to content

Conversation

@asabri97
Copy link
Collaborator

@asabri97 asabri97 commented Oct 15, 2025

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Adds customizable annotation styling across the iOS app with a new AnnotationConfig, UI controls for font size, and smarter scaling—making YOLO overlays clearer and more adaptable. ✍️🖼️

📊 Key Changes

  • New AnnotationConfig struct to control font size, line width, and font weight for annotations.
  • Updated drawing APIs to accept an optional config (default provided) across:
    • Object detection, classification, pose, segmentation, and OBB rendering.
  • Convenience overloads to set only font size without touching other params.
  • YOLOView now stores and applies annotationConfig; dynamically updates existing box views.
  • External display-aware scaling for larger screens; uses config for regular displays.
  • New font size slider and labels in ViewController for live UI control.
  • New Notification: fontSizeDidChange for external display sync.
  • App build number bumped (CFBundleVersion 535).

🎯 Purpose & Impact

  • Clearer overlays: Users can easily adjust label size and box thickness for readability. 🔎
  • Consistent styling: One config applied across all visualization types. 🎨
  • Better large-screen support: Smarter scaling on external displays improves presentations and demos. 🖥️
  • Backward compatible: Defaults preserve current behavior; existing calls continue to work. ✅
  • Developer-friendly: Simple API to tweak visuals programmatically or via UI. 🧩

Example usage:

// Programmatic control
let config = AnnotationConfig(fontSize: 18, lineWidth: 4, fontWeight: .bold)
yoloView.setAnnotationConfig(config)

// Drawing call with config (defaults if omitted)
let image = drawYOLODetections(on: ciImage, result: result, config: config)

// Or quick font-size-only helpers
let image2 = drawYOLODetections(on: ciImage, result: result, fontSize: 20)

@asabri97 asabri97 self-assigned this Oct 15, 2025
@asabri97 asabri97 temporarily deployed to Release - TestFlight October 15, 2025 21:20 — with GitHub Actions Inactive
@UltralyticsAssistant UltralyticsAssistant added the enhancement New feature or request label Oct 15, 2025
@UltralyticsAssistant
Copy link
Member

👋 Hello @asabri97, thank you for submitting an ultralytics/yolo-ios-app 🚀 PR! This is an automated response to help get things moving quickly — an Ultralytics engineer will also review and assist you here shortly. In the meantime, please review the checklist below to ensure a seamless integration of your work:

  • 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-ios-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

Additional notes for this PR:

  • The new AnnotationConfig and added overloads look great for making YOLO overlays more adaptable. Please confirm defaults preserve current behavior across detection, classification, pose, segmentation, and OBB.
  • Since you’ve introduced UI controls (slider/labels) and notifications, consider adding a brief usage note in code comments for YOLOView.setAnnotationConfig(_:) and ViewController.setupFontSizeControls() to guide developers.
  • If any public API signatures changed (e.g., added config: parameters), highlight backward compatibility in the PR description and ensure sample usage is reflected in app UI or docs.
  • A quick screen capture or screenshots demonstrating external display scaling and the font-size slider would help reviewers validate UX changes. 📱🖥️

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! ✍️🎨🚀

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 31.25000% with 66 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
Sources/YOLO/Plot.swift 45.45% 36 Missing ⚠️
Sources/YOLO/YOLOView.swift 0.00% 30 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to Customise Annotation Label Font Size in Swift Integration

3 participants