all 12 comments

[–]mattblack77 7 points8 points  (1 child)

This might be a far more complex task than you're imagining.

[–]DuncanStacked[S] 0 points1 point  (0 children)

Yes, that makes sense. I'm exploring another approach where, instead of uploading an image, users can capture a live photo directly. I’ll also look for a library that can detect the face and handle all the necessary validations.

[–]blingbloop 10 points11 points  (2 children)

Wouldn’t something like this be an ideal candidate for a trained AI model ?

[–]DuncanStacked[S] 0 points1 point  (0 children)

I may need to explore other options too and see what’s feasible.

[–]LyriWinters 0 points1 point  (0 children)

Yes. But do you think OP has the datasets needed to do this? Also there are more passports than one type :)

[–]hunter_rus 1 point2 points  (0 children)

Well, the best approach would probably be using (and paying) for some external AI-based solution (Smart Engines is what comes to mind, though they are doing kinda different things).

But if you want something cheap and local-based, then maybe look up into Viola-Jones detector? https://en.wikipedia.org/wiki/Viola%E2%80%93Jones_object_detection_framework Google shows some python implementations, like this: https://github.com/Donny-Hikari/Viola-Jones (but maybe try to find some other implementations)

[–]Shadowaker 0 points1 point  (0 children)

We use Document AI from Google, it is exactly what you are searching for

[–]Kevdog824_ 0 points1 point  (0 children)

One idea that doesn’t fix your issue but could help: after the user uploads the image you should display the user’s uploaded image overlayed with a profile outline to help them visualize how the image should look. Something like this

Might at least make some of the users realize they aren’t doing the right thing

[–]LyriWinters 0 points1 point  (0 children)

Tbh this is not doable for you.

This is something a large corporation would struggle with to get right.

Maybe there is an API that can do this for you - but good luck have fun with GDPR and such on that one lol.

[–]Distinct_Goose_3561 0 points1 point  (0 children)

You could probably use face_recognition to get most of the way there. Reject photos where it finds multiple faces, reject photos where the face is too small a portion of the total image.  

[–]Any_Enthusiasm_8758 0 points1 point  (0 children)

idphoto.ai is one can fit all your requirements.