Skip to content
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

feat: implement switch camera #86

Closed
wants to merge 3 commits into from
Closed

feat: implement switch camera #86

wants to merge 3 commits into from

Conversation

asabri97
Copy link
Contributor

@asabri97 asabri97 commented Jan 13, 2025

I have read the CLA Document and I sign the CLA

Closes

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

This PR introduces numerous improvements to the YOLO Flutter app, including camera handling updates, dependency upgrades, and enhanced method handling for smoother object detection and camera operations.

📊 Key Changes

  • Camera Handling:

    • Fixed camera toggle logic to properly handle binding/unbinding for smooth switching between front and back cameras.
    • Refactored camera switching and added safeguards, ensuring robust operations (isSwitchingCamera added for preventing race conditions).
    • Improved iOS camera setup and switching, allowing seamless transitions between camera directions with clear debug logs.
  • Codebase Refactor & Debugging:

    • Added detailed debug logs throughout the app for troubleshooting critical operations (e.g., permission checks, model loading, camera setup).
    • Simplified and structured code for better readability (switch-case improvements in method handlers on iOS).
  • Dependency Updates:

    • Updated app dependencies such as permission_handler_apple, leak_tracker, and development tools, resolving known issues and improving compatibility.
  • iOS Improvements:

    • Reworked iOS camera-related code to handle tasks like video frame capture, switching cameras, and loading machine learning models asynchronously.
    • Added structured handling for video streams, device access, and UI updates to improve performance and stability.

🎯 Purpose & Impact

  • Improved Camera Operations: Ensures bug-free handling of camera toggling, reducing crashes and errors for users.
  • Enhanced User Experience: Updates to permission handling, loading models, and debug errors prevent app freezes or failures, ensuring smooth app operation.
  • Better Maintainability: Refactored and organized code simplifies future iterations and debugging, reducing developer effort.
  • Future Compatibility: Dependency updates and platform-related improvements ensure continued compatibility with the latest Flutter and iOS versions.

🚀 These updates will smoothen the object detection workflow, making the app more robust and user-friendly! 😊

Copy link

github-actions bot commented Jan 13, 2025

All Contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@UltralyticsAssistant UltralyticsAssistant added dependencies Dependencies and packages devops GitHub Devops or MLops enhancement New feature or request labels Jan 13, 2025
@UltralyticsAssistant
Copy link
Member

👋 Hello @asabri97, thank you for submitting this awesome ultralytics/yolo-flutter-app 🚀 PR! We appreciate your contributions to improving the project. To help ensure a smooth review process, please check the following details:

  • Define a Purpose: Clearly explain the purpose of your PR in the description above. Kindly ensure it addresses the linked issue (Closes) and outlines the context and intent of the changes made.
  • Synchronize with Source: Confirm that your PR is up-to-date with the latest main branch. If it’s behind, you can rebase or use git pull --rebase to resolve conflicts locally.
  • Ensure CI Checks Pass: Verify that all Continuous Integration (CI) checks pass successfully. If any checks have failed, please address them to avoid delays.
  • Add Documentation and Tests: If applicable, ensure you’ve updated relevant documentation and included tests to validate the intended functionality of camera switching and other updates. Testing the breaking/debugging improvements is particularly important here as new behavior is introduced.
  • Sign the CLA: If this is your first contribution, please sign our Contributor License Agreement (CLA). You can do so by commenting below with: "I have read the CLA Document and I sign the CLA."
  • Minimize Code Changes: Limit changes to what is necessary for the feature, bug fix, or improvement discussed. It helps us focus better during the code review 😊.

If any of the PR-specific changes introduced require further clarification (e.g., switchCamera method updates, debug logs, or dependency upgrades affecting compatibility), please elaborate further in the PR description. For debugging adjustments in particular, ensure related tests and edge cases are handled.

For more guidance, please refer to our Contributing Guide. If you have questions, feel free to ask here, and don’t worry—an Ultralytics engineer will provide assistance soon! 👨‍💻👩‍💻

🚀 Keep up the great work, and thank you for contributing to Ultralytics!

Made with ❤️ by Ultralytics

@asabri97 asabri97 assigned john-rocky and asabri97 and unassigned john-rocky Jan 13, 2025
@asabri97 asabri97 requested a review from john-rocky January 13, 2025 17:11
@asabri97
Copy link
Contributor Author

I have read the CLA Document and I sign the CLA

@john-rocky
Copy link
Collaborator

@asabri97
The bounding box is misaligned when switching to the front camera.
We need to revise the bounding box code for the front camera so that it surrounds the detected object.

@asabri97 asabri97 closed this Jan 23, 2025
@asabri97 asabri97 deleted the bug/switch_camera branch January 23, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Dependencies and packages devops GitHub Devops or MLops enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants