justadudewhohacks / face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
MIT License
16.51k stars 3.68k forks source link

Rotate for lock viewport #292

Open 1ucay opened 5 years ago

1ucay commented 5 years ago

Can you please add new options for rotate? Like rorate 90 for 90deg. Nice would be "-180" for mirroring. If you try on mobile window.screen.orientation.lock('portrait-primary');, faces in webcam in landscape are in trouble. Have you some solution for that? I can detect right position (landscape/portrait) via event "devicemotion", but I dont know, how can I "rotate" recognize algoritmus.

Thank you so much.

justadudewhohacks commented 5 years ago

Hi.

I don't quite understand how rotation by 90 degree would be any useful to the algorithm. Furthermore, I don't understand why you would need to mirror the images. All the nets are invariant to whether the image is mirrored or not.

noambonnie commented 4 years ago

I think the problem described above pertains to the case that faces are not detected if they're not in the right orientation. In our tests, face is hardly ever detected when rotated 90 degrees. We're looking for ways around it - probably manually rotate and retry the detection.

I'm unsure if that's the best solution.

1ucay commented 4 years ago

yes exaclty noambonnie, thank you.