-
Notifications
You must be signed in to change notification settings - Fork 22
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
[BUG] Pixel 7a detected face boundaries not correct #30
Comments
@nonam4 I also btw just experienced a similar issue on iOS, not sure if it's the same cause, but basically You are making assumptions about a preview view here, whereas the coordinate system of a Frame Processor should always be the same of the The user is responsible for converting that to preview coordinates. Maybe I can expose a function that does that. And in my case that was wrong (I explicitly patched this lib and set So I recommend you remove the scaling from your code, and let the user manually convert that to preview coordinates if needed. In Skia Frame Processors the user doesn't need to do that, it is just always the Frame coordinates. |
yup, and in JS I could expose a method to do this then. |
I already removed scaling in 67d98f4. |
Hm, technically the user can also implement this. We just need to scale frame.width/height to view.width/height by applying a center-crop, and then optionally also rotate starting from frame.orientation to current view rotation. That's it |
you mean this removed function? 😅 |
uhm yea lol I mean exactly that. On iOS the Frame.orientation is now correct I think - it's always portrait. |
But this removed function has the same code as native one and will bring incorrect face boundaries as i mentioned in topic. Am i understand right? android
js
|
@imelos Doing this scaling on js side using
I'm still testing but I suppose this makes difference on scaling. |
@nonam4 Now i understand. Thank you! |
My 2 cents are; if you run something on a Frame, the returned coordinates should be relative to the Frame. The user is responsible for converting that to the Preview later. Maybe I'll add a helper function for this at some point. |
@nonam4 i switched to js side scaling calculation and its fixed my issue. The problem was as you mentioned before - because of wrong scaling calculations between native and js |
Cool yea making it optional on the native side is an okay solution for now.
Thanks for your hard work man, I'm probably gonna use this plugin as a prime example to show off how VisionCamera Plugins work if that's cool with you? |
@mrousavy Sure man, for me it's an honor to have you using my plugin 😁 |
@imelos Can you please test if v1.5 branch fix the issue? |
nonam4 Yes. Without autoScale it works well. Thank you. |
@nonam4 Hi, Nonam. I have also face bound size problems in different devices. When can i install your last solution? It is urgent little bit. Thanks very much. P.s I tested in different devices. 2 Samsung device, 2 Huawei, 1 Xiaomi devices. Almost all of them returned different sizes. I am using this version (https://www.npmjs.com/package/react-native-vision-camera-face-detector/v/1.5.0) |
@nonam4 hi. I hope your works are good. I get Frame Processor Error: Regular javascript function '' cannot be shared. Try decorating the function with the 'worklet' keyword to allow the javascript function {hasPermission && ( I enabled processNestedWorklets to true already |
i test on
Xiaomi MI A2 Lite
and have correct face boundaries.My friend test on
Pixel 7A
and receive not correct boundaries shifted left and bottom.I don't have access to
Pixel 7a
to try reproduce and fix this.Any ideas is this possible to fix?
MI A2 Lite
Pixel 7a
The text was updated successfully, but these errors were encountered: