r/reactnative • • May 07 '21

Eye Blink/Smile Detection with RNCamera

225 Upvotes

34 comments sorted by

14

u/Sanket_Gadge May 07 '21

Hi guys, So everyone's asking me for the code, firstly I thought i will post a tutorial and code together but tutorial will take some time, so here's the link for the code: https://github.com/Sanket758/RN-Blink-Smile-Detection

clone=> npm i => npm start (keep it running) => another terminal => npm run android

2

u/Wesley_Ford_Sr May 07 '21

Awesome - Thanks for sharing this my dude!

6

u/saltpeter_grapeshot Expo May 07 '21

How come eye open probability goes above 1?

3

u/Sanket_Gadge May 08 '21

actually it is combined probabikity of left and right eye, so it goes above 1 sometimes

1

u/saltpeter_grapeshot Expo May 08 '21

Makes sense. Thanks πŸ˜€

6

u/[deleted] May 08 '21

I think it's up to 1 for both eyes (aka up to 2 total). Not saying is correct, just looks like it based on his eyes positions

1

u/saltpeter_grapeshot Expo May 08 '21

Great point! I think you're right.

6

u/brentvatne Expo Team May 08 '21

looks a lot like this expo camera example repo from 3 years ago πŸ˜… https://github.com/expo/camerja/blob/41c405e77762057a3740b85c444dd857f88b12d9/App.js#L176-L239. good to see people discovering some of the neat stuff you can do with face detection though!

1

u/Sanket_Gadge May 08 '21

Well yeah, All the credits goes to people who created this camera library. Being a ML developer working with the mobile technology for the first time, I am completely amazed by the work these guys have done on this library.

1

u/breezy_y Nov 28 '22

is blink-detection possible with just the expo camera?

1

u/brentvatne Expo Team Nov 28 '22

yes. this works in react-native-camera because it was copy+pasted out of expo-camera :P

2

u/[deleted] May 07 '21

Can you share your source code

5

u/Sanket_Gadge May 07 '21

Yeah, I am working on creating a tutorial for this, i will update this post with the link for tutorial as well as code. Meanwhile you can check my other projects at www.github.com/sanket758 or http://sanketgadge.herokuapp.com/

-5

u/[deleted] May 07 '21

Please remind me as soon as you finish it, my email is [email protected]

10

u/yash-vardhan May 07 '21

Great work man, I'll follow you so that I don't miss another update on this

9

u/[deleted] May 07 '21

This is what Zuck sees when you are on the can

1

u/anions May 08 '21

but i thought hes a robot

1

u/PlaneReflection May 08 '21

That’s how he can see everyone at once

1

u/j0hnasd May 07 '21

Awesome! I suggest fixing the text so it doesn't jump so much and it's easier to read.

2

u/Sanket_Gadge May 07 '21

Yes, I should but for my use case, I dont want to show that to user, I just want to capture the selfie when blink is detected...thats why I have not done that, I am only using it for debugging so that i can see the numbers

2

u/[deleted] May 07 '21

Great

2

u/[deleted] May 07 '21

Why the eye open probability sometimes goes over 1?

3

u/Fermented_Pizza_Roll May 07 '21

He problaby forgot to softmax the outputs. Logits on the screen, not probabilities.

2

u/JuriJurka May 07 '21

impressive!!! great work buddy!

2

u/Significant-Jury7142 May 08 '21

Omg! Really cool.

1

u/Goel40 May 07 '21

Why do the scores have so many decimals?

1

u/[deleted] May 07 '21

are you using tensorflow.js posenet

1

u/[deleted] May 07 '21

I wonder if it easier with the new camera and worklets

1

u/yudhiesh May 08 '21

Did you use Tensorflow.js for this?

1

u/nathan_Guedes May 08 '21

How do you make to rncamera send stream from video to a function in real time ?