ultralytics / yolo-flutter-app

A Flutter plugin for Ultralytics YOLO computer vision models
https://ultralytics.com
GNU Affero General Public License v3.0
36 stars 14 forks source link

Process frames from camera controller stream #25

Open Swepilot opened 1 month ago

Swepilot commented 1 month ago

In our app we are currently running detection with an in-house iOS specific plugin that processes the CameraImage from camera controller stream.

Simplified code:

cameraController!.startImageStream((CameraImage img) async {
   String? result = await imageAnalyser.analyze(img);
});

Would it be possible here in yolo-flutter-app to process the images like this from the stream. Currently I only see the option to use the included preview widget or reading from a stored file.

pderrenger commented 1 month ago

Hello!

Yes, you can process images directly from the camera stream in the yolo-flutter-app. You would need to modify the existing image input method to integrate the camera stream processing similar to your current setup.

Hereโ€™s a basic outline of what you might do:

  1. Instead of using the preview widget or reading from a file, set up the camera stream as the input source.
  2. Convert the CameraImage to a format compatible with the model (typically a Tensor or similar data structure).
  3. Pass this converted image to the model for inference.

You might need to handle image conversion, ensuring the format and dimensions are compatible with what your YOLO model expects.

If you encounter any specific issues while implementing this, feel free to share them here, and Iโ€™d be happy to help further!

Best of luck with your integration! ๐Ÿš€

github-actions[bot] commented 4 days ago

๐Ÿ‘‹ Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO ๐Ÿš€ and Vision AI โญ