Skip to content

Conversation

@asabri97
Copy link
Collaborator

@asabri97 asabri97 commented Oct 15, 2025

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Adds a centralized AnnotationConfig and UI controls to customize annotation font size/line width across the YOLO iOS app for clearer, more adaptable overlays 🔤📦

📊 Key Changes

  • Introduced AnnotationConfig (font size, line width, font weight) to control how labels/boxes are rendered 🎛️
  • Updated all major rendering paths in Plot.swift to accept config: AnnotationConfig = .default:
    • detections, classifications, pose, segmentation, and OBB rendering 🖼️
  • Added convenience overloads to draw with just fontSize (wrapping into AnnotationConfig) for simpler call sites 🧩
  • Enhanced YOLOView with:
    • annotationConfig property
    • setAnnotationConfig(_:) to update existing bounding boxes and handle “external display” scaling automatically 🖥️
  • Added a new notification fontSizeDidChange for optional external display syncing 📢
  • Added a font size slider + labels in ViewController to let users adjust annotation text size at runtime 🎚️
    • Updates YOLOView live and broadcasts the change via NotificationCenter

🎯 Purpose & Impact

  • Improves readability of labels and overlays, especially on large screens/external displays 🖥️👀
  • Gives developers and users consistent, app-wide control over annotation styling instead of fixed auto-scaling 🎨
  • Reduces duplication and makes future styling tweaks easier by routing sizing/weight decisions through one config object 🧱
  • Potential impact: minor API surface change (new optional config parameters) but remains backward-friendly due to defaults (.default) ✅

@asabri97 asabri97 self-assigned this Oct 15, 2025
@asabri97 asabri97 linked an issue Oct 15, 2025 that may be closed by this pull request
@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!

@asabri97
Copy link
Collaborator Author

in latest yolo26 PR

@asabri97 asabri97 closed this Jan 13, 2026
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