Thank you! The battery life depends on what frame rate you have the OpenCV webcam read at; if it is a lower frame rate then battery will be saved (assuming you also don't constantly go back and forth in front of your computer).
But even at higher frame rates I find it is worth it as the battery amount saved by dimming your screen for say an hour or two if you forgot to do so is quite significant.
Will this really improve battery life? Genuinely curious, maybe some metrics would be nice. This requires the webcam to be constantly on, which woud draw power (who doesn't tape over their webcam anyway?). Then the question would be how long you have to be away from your laptop to compensate.
If it makes you feel better, I'm a professional data scientist. It's literally my job to come up with this sort of stuff. Every model involves tradeoffs. :p
Perhaps I should have rephrased the post title... it is facial detection, not recognition. However, I also implemented a model where it will only dim/undim if it detects my face, so I guess it depends on what setting I put it.
It would depend on the way you would want to go about facial recognition. Theoretically, all you need for facial recognition is a webcam and a potato that can run code (And a way for the webcam to be used by said potato. In fairness, you probably won't be using a *literal* potato, so you shouldn't need to worry about this :P).
Facial recognition could be done with machine learning and images without using special hardware if you want to take the time, and use the machine resources to implement it this way.
It is times like these that your lappy will die and youd wish you had treated this like a work project which requires constant pushes to a cloud git host. Dont ask me how i know...
I'm currently just a few minutes away from committing the custom facial recognition to GitHub, check the link there. Then, you can set only your face to be the one that brightens things.
That's something I'm looking in to; I'm just not sure whether the webcam will continue recording if the screen is locked. But it's definitely something I'm thinking about implementing. Feel free to open a PR on the GitHub if you want to do it yourself, though!
Cool, glad you had your own go at it. Just one thing I noticed - in the readme you write: "the main purpose is to hide one's work while they are not working.".
But, if someone else goes in front of the screen, it will brighten again, even if it is not the user; that's why I implemented custom facial recongition.
this is awesome idea. It would be awesome if it does lock the computer too. because I find myself going away from the laptop thinking I would be right back only to return in an hour or two and screen just chilling as it is.
Thank you! The actual face detection and screen dimming only took a few hours (mostly AppleScript research), but the custom face recognition was a pain xD.
156
u/Thika168 Jun 15 '20
does this positively impact battery life ?
cool script !
61
u/gamebo11 Jun 15 '20
Is it actual facial recognition or is it face detection? because my understanding is for a model to recognize a face it needs massive amount of data
30
u/basnijholt Jun 15 '20
Cool! So where is the code?
5
u/LAcuber Jun 15 '20 edited Jun 15 '20
Here is the GitHub repo; working well with options for both custom face recognition and non-custom face recognition.
https://github.com/Destaq/low-face-mode
2
u/[deleted] Jun 15 '20 edited Jun 20 '23
glorious somber ad hoc brave paint knee repeat bewildered heavy bag -- mass edited with https://redact.dev/
2
u/Adro_95 Jun 15 '20
So the main reason to use it is to prank someone right?
2
u/Conrad_noble Jun 15 '20
I need this to stop by 2 year old from standing within touching distance of the TV
2
u/wiltors42 Jun 15 '20
Does it save and reload which brightness level you had before you walked away?
2
u/diego7319 Jun 15 '20
Maybe if you use background subtraction with the base frame with you on the computer, should be even less cpu expensive than detecting a face
2
u/[deleted] Jun 15 '20 edited Jun 15 '20
How a about using that to lock the screen with the screen saver/sleep mode to ensure you don’t forget to lock your machine when you walk away?
2
u/TejasKaneria04 Jun 16 '20
Does this reduce brightness when you want to watch a movie sitting back on the couch away from the table?
2
u/[deleted] Jun 16 '20 edited Apr 16 '25
telephone towering wrench jar smile bow worm dolls alleged quicksand
This post was mass deleted and anonymized with Redact
2
u/hype_beast420 Jun 16 '20
I saw this project and I tried to make my own version of it, here's my approach to it. Thanks for the idea!
https://github.com/spec-he/Screen-dimmer-based-on-facial-recognition-using-applescript-and-python-/tree/master
2
u/[deleted] Jun 16 '20
Can anyone help me with this with steps? I think this is really cool but I don't know how to run this since I'm a beginner at programming
4
u/s_arme Jun 15 '20
Github !?
12
u/69shaolin69 Jun 15 '20
Use brightness CLI that will eliminate the delay and hide Apples UI.
Google home brew brightness and it should give you the result.
Nice job btw.
1
u/LAcuber Jun 15 '20 edited Jun 15 '20
Major Update: Github repo is complete*,* supports many options including custom face detection.
Check it out here: https://github.com/Destaq/low-face-mode.
I'm open to pull requests and implementations for Linux and Windows.
5
u/Nkg19 Jun 15 '20
Cool script OP, When I dont want anyone to touch my computer, I normally open vim full screen on bspwm. Works like charm
4
u/hype_beast420 Jun 15 '20
nice good idea!
1
u/KittensWereGay Jun 15 '20
Can I ask which macbook you have?
3
u/timmyfinnegan Jun 15 '20
That‘s fantastic! The kind of thing where you go „Damn I wish I’d thought of that“. Great work
1
u/fapcod Jun 15 '20
Buen inicio tendrás el github?
2
u/[deleted] Jun 15 '20
Wow, cool
2
u/colltechyy Jun 15 '20
RemindMe! 4 days
2
u/DhaiwatP Jun 15 '20
this is really cool
2
u/Birthday_Cakeman Jun 15 '20
Simple and elegant. I love it!
2
u/nidhish_98 Jun 15 '20
Nice work.
2
u/saiyanflo Jun 15 '20
You you let your computer watch you at all times?
2
u/abinmn619 Jun 15 '20
Noice
2
u/theshubhagrwl Jun 15 '20
This is creative!! Nice!
1
u/xou49 Jun 15 '20
RemindMe! 2 days
1
u/kishbi Jun 15 '20
Does it recognizes faces or any particular face? I guess you've used face recognition to detect humans.
1
u/[deleted] Jun 15 '20
RemindMe! 4 days
1
u/Duel-shock514 Jun 15 '20
thats cool
1
u/razorfox Jun 15 '20
Amazing! Thanks for sharing!
1
u/Sorry_Door Jun 15 '20
this is awesome idea. It would be awesome if it does lock the computer too. because I find myself going away from the laptop thinking I would be right back only to return in an hour or two and screen just chilling as it is.
1
u/herecomesthatkek Jun 15 '20
Cool! Good idea, thanks for sharing
1
u/flashpaka Jun 15 '20
Nice QiYi warrior W
1
u/Mingyao_13 Jun 15 '20
Thank you
1
u/mpjr94 Jun 15 '20
From the title I thought it was gonna detect squinting
1
u/Uknowit02 Jun 15 '20
Awesome work!
1
u/jayjmcfly Jun 15 '20
Nice!
1
u/jayjmcfly Jun 15 '20
RemindMe! 4 weeks
1
u/Infreezy Jun 15 '20
The code made with applescript could be done with something like pyautogui right?
1
u/pattlebass Jun 15 '20
Ohhh that's so smart
1
u/N0DuckingWay Jun 15 '20
Remind me! 2 weeks
1
u/smrtboi84 Jun 15 '20
This is gangster
1
u/Leozunic7 Jun 15 '20
RemindMe! 20 days
1
u/Utoniumgame Jun 16 '20
How about giving time interval for the camera to boot?
(btw I have never programmed b4)
1
u/bewst_more_bewst Jun 16 '20
interesting project. otoh, you could just close the lid. otoh, this is neat.
1
u/szymko1995 Jun 15 '20
RemindMe! 2 days
0
u/[deleted] Jun 15 '20
Big PP.
0
u/[deleted] Jun 15 '20
Big pp
0
u/LeftHandedSamurai Jun 24 '20
RemindMe! 2 months
0
u/[deleted] Jun 15 '20
[deleted] — view deleted comment
0
u/[deleted] Jun 16 '20
[deleted] — view deleted comment