brianmtully/flutter_google_ml_vision

ALL_FACE contour positions wrong on iOS

Closed this issue · 5 comments

Same flutter code, using the same contour indexes (based on official doc) - iOS clearly has an issue. The code worked fine with the dead firebase_ml_vision plugin.

The code below looks okay to me, since it's pretty much the same as on Android. But I guess there is some issue with the contour parts 🤔 order.

+ (id)getContourPoints:(MLKFace *)face contour:(MLKFaceContourType)contourType {

Android iOS
android ios

Can you provide your drawing function for the contours that you are using?

Sure, here is a gist with the CustomPainter and snippet of its usage, should be easy to add into the plugin sample.

https://gist.github.com/shliama/f1ae6add1c879a0b0404e91fc1ae2f39

So after further inspection, the contours array returned on iOS are not in the order that you are expecting. The iOS MLKit doesn't seem to follow the order from the documentation when I grab all of the contours of a face. In order to get the result you expect I probably have to go one by one and input them into the resulting array.

allPoints isn't actually a contourType if you look through the documentation. I am just pulling all the points by looping through all the actual contours.

Changed the code based on your idea - #16
Tested with my mask and everything looks perfectly aligned now between iOS & Android.

thank you, I merged your pull request.