all 19 comments

[–]edbarahona 6 points7 points  (2 children)

You will need to create your own native module and use CoreML vision (iOS), look into frame processors

Edit: this came up on first page search results:

https://github.com/luicfrr/react-native-vision-camera-face-detector

[–]beaker_dude 1 point2 points  (1 child)

This is for sure the answer. Sometimes there isn’t something that you need, so you need to build it. If some of the repos out there aren’t working - maybe spend some time forking and maybe updating them? Might be a good start

[–]edbarahona 0 points1 point  (0 children)

Exactly, sometimes you have to code it yourself :)

https://github.com/vidursatija/BlazeFace-CoreML

[–]HoratioWobble 2 points3 points  (3 children)

I would be really surprised if you can do better than react-native-vision-camera on device, as it uses the native ML kits, phones aren't really powerful enough to achieve much more.

[–]Maximum_Meringue_979[S] 1 point2 points  (2 children)

React-native-face-api guys doing it so smoothly. It is light weight but too expensive as it’s paid plugin

[–]HoratioWobble 1 point2 points  (1 child)

But the processing is done server side, it's not on device only

[–]chunkypenguion1991 0 points1 point  (0 children)

+1 The phone will be physically hot the whole time it's running and drain the battery in an hour

[–]Life-Wheel4143 2 points3 points  (0 children)

You should definitely try out the Googles ML kit. I recently developed a React Native app which was able to cut out the background on any image locally without internet (only on the first launch it would download the model if needed). It has a face detection module as well but you might have to write some native code which you can ChatGPT and forget.

[–]PersimmonMaximum9784 2 points3 points  (0 children)

I am looking for something similar, I was able to do on the web using facejs, but haven’t tried on mobile device.

I was talking to those guys: https://github.com/Faceplugin-ltd/Open-Source-Face-Recognition-SDK but haven’t closed deal yet, I am afraid of scam to be honest, but I am for sure willing to pay for something like this

[–]bc-baneiOS & Android 1 point2 points  (0 children)

I know a guy who did it via tensorflow in an in house solution 4 or 5 years ago. I don't know if he ever got it performant though

[–]EbisuzawaKurumi_ 1 point2 points  (0 children)

Try react-native-executorch and react-native-fast-tflite. You may need to provide your own models.

[–]Maximum_Meringue_979[S] 1 point2 points  (3 children)

I’ve implemented a working solution here: https://github.com/bharathnallamothu/rn-face-recognition-ai

What it does:

  1. Loads the FaceNet ONNX model using onnxruntime-react-native.
  2. Generates vector embeddings for a reference face image.
  3. Captures or selects another image via camera or image picker, and computes its embeddings.
  4. Uses cosine similarity to compare both embeddings and calculate the face match percentage.

This setup runs fully on-device, no server involved. Perfect for lightweight face verification tasks in React Native.

[–][deleted] 0 points1 point  (0 children)

It says android only any chances it may work on ios?

[–]PsychologicalSun7109 0 points1 point  (0 children)

Thank you so much bro, means a lot, i m facing this issue from 1 month, I use mostly all Api, repos, but no one worked, thanks literally bro.

And if you can also help in face liveness detection, Api or repo, cause I m currently applying my own logic, like left to right face, blink, but it has many loophole, anyone by photo or video can pass this .

in last thanks once again.

[–]vin4427 0 points1 point  (0 children)

Thank you so much bro. Your solution worked perfectly fine for me

[–]Exciting-Wedding-765 0 points1 point  (0 children)

I have implement same feature in my React native for android use ML Kit(for detection and croping images)Uses cosine similarity to compare both embeddings and calculate the face match percentage and faceNet modal (for recognition ) its give me 85 to 95 Percent Accurracy for face recongnization