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

deferred processing for better performance of android #71

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yangga
Copy link
Contributor

@yangga yangga commented Oct 28, 2024

Added delayed prediction processing feature for smooth camera frame rendering on Android. After analyzing the ImageAnalysis code of Android, it expected that frame dropout would occur if the analyzer logic declared with setAnalyzer is not processed as fast as possible even if "ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST" is used.
If "deferredProcessing" mode is used, the requested analyze is skipped while the prediction is processed in the sub thread.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

This PR introduces deferred processing for camera frames in the YOLO Flutter app, optimizing image analysis performance on Android devices.

📊 Key Changes

  • Added a deferredProcessing option in the camera setup that delays frame processing.
  • Introduced a thread-based executor service to manage deferred frame analysis.
  • Updated the camera controller and related classes to handle the new option.

🎯 Purpose & Impact

  • Enhanced Performance: By deferring processing, the system avoids overloading with frame data, especially useful on less powerful devices, leading to smoother operation and improved responsiveness. 🚀
  • Flexible Configuration: Users now have the option to enable or disable deferred processing based on their device's capabilities or specific application needs. 🤖

@UltralyticsAssistant UltralyticsAssistant added embedded Pertaining to IOT or low-power devices enhancement New feature or request labels Oct 28, 2024
@UltralyticsAssistant
Copy link
Member

👋 Hello @yangga, thank you for submitting a PR to the ultralytics/yolo-flutter-app 🚀! This is an automated response to help guide you through the contribution process. An Ultralytics engineer will be with you shortly to assist further. Meanwhile, please make sure your PR complies with the following checklist:

  • Define a Purpose: Clearly articulate the purpose of your changes in the PR description, and refer to any relevant issues if applicable. Ensure your commit messages are clear and conform to the project’s style.
  • Synchronize with Source: Ensure your PR is up-to-date with the latest main branch of ultralytics/yolo-flutter-app. You can update it by clicking the 'Update branch' button or via git pull and git merge main locally.
  • Ensure CI Checks Pass: Confirm that all Continuous Integration (CI) checks pass. If any checks fail, please revise your changes to fix the issues.
  • Update Documentation: If necessary, update any relevant documentation to reflect your changes.
  • Add Tests: Include tests to cover your feature or bug fix as needed, ensuring all tests pass successfully.
  • Sign the CLA: If this is your first PR with Ultralytics, ensure you have signed the Contributor License Agreement by writing "I have read the CLA Document and I sign the CLA" in a new comment.
  • Minimize Changes: Focus your changes on the specific issue or feature. Keep your modifications as succinct as possible to ensure an easy review process. "Simplicity is the ultimate sophistication." — Leonardo da Vinci

For more detailed guidance, check out our Contributing Guide. Should you have any questions, feel free to ask. Thank you for your contribution to Ultralytics! 🌟

@pderrenger
Copy link
Member

@yangga thank you for your contribution! The deferred processing feature sounds like a valuable enhancement for improving performance on Android devices. If you have any specific questions or need further assistance, feel free to ask.

@yangga
Copy link
Contributor Author

yangga commented Nov 9, 2024

@pderrenger Is there any next step to me? Should I update the document for this commit? Let me know if I have anything to do.

@pderrenger
Copy link
Member

Thank you for your contribution! Please ensure the documentation reflects the changes made in your commit, and feel free to submit a pull request for any updates.

@yangga
Copy link
Contributor Author

yangga commented Nov 10, 2024

@pderrenger I've updated README.md. Thanks.

@pderrenger
Copy link
Member

You're welcome! If you need further assistance or have any questions, feel free to ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedded Pertaining to IOT or low-power devices enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants