googlesamples / googlesamples/mlkit
MLKit and Camera2 integration in Android
- Dominant language
- Kotlin
- Stars
- 4.3k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
I have an Android camera app that uses Camera2 API and sends frames to a server. I recently did some work on top of MLKit's [segmentation example code](https://github.com/googlesamples/mlkit/tree/master/android/vision-quickstart/app/src/main/java/com/google/mlkit/vision/demo/java/segmenter) that generates masks and graphics overlay, etc. Now I want to integrate this MLKit demo into our app, but not sure how to integrate these two together.
Given my implementations are in [segmentation example code](https://github.com/googlesamples/mlkit/tree/master/android/vision-quickstart/app/src/main/java/com/google/mlkit/vision/demo/java/segmenter), so my main question is how I can exactly call these functions in the demo from inside our camera app. I assume I should pass some variables like frames from our camera app to this MLKit demo and start processing them, and return something. Are these compatible together, given our app uses Camera2 API?
For example, I should first initialize a new `VisionImageProcessor imageProcessor`. Then just call `processByteBuffer()` or maybe `processBitmap()`? But we have graphicOverlay. What exactly these steps look like in my case? And is it best to pass frames as byteBuffer or media.Image or what for best performance?
Any tips or guidance on integration and tips would be appreciated.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.