Automating My Life with Python | Using Computer Vision to Detect How Often I Drink Coffee

preview_player
Показать описание
In this video, we will build a Python script I created that uses OpenCV, a powerful computer vision library, to detect when I take a drink of coffee from my mug in real-time. The script harnesses the capabilities of computer vision to analyze video frames captured from my camera.

Throughout the video, you'll see how the script detects my face in each frame and focuses specifically on the mouth region. By counting the number of white pixels in the mouth area and comparing it to a predefined threshold, the script can determine if I am drinking coffee at any given moment.

Whenever the script detects that I am taking a sip of coffee, it instantly prints a message to the console and plays an audible sound notification to alert me. This real-time feedback allows me to keep track of my coffee consumption habits effortlessly.

The script remains active, continuously monitoring my actions until I press the 'q' key to quit the program. This video showcases the power of combining Python programming with computer vision techniques to create practical and interactive applications.

If you're interested in learning how to develop similar computer vision projects or want to explore the capabilities of OpenCV, this video is a great starting point. I provide step-by-step explanations of the code and demonstrate how you can adapt it to suit your own needs.

So, grab a mug of your favorite coffee, sit back, and join me as we dive into the world of real-time coffee drinking detection using Python and OpenCV!

Don't forget to like, share, and subscribe to my channel for more exciting videos on tech, future tech, AI and more. Leave a comment below if you have any questions or suggestions for future projects.

Automating My Life with Python | Using Computer Vision to detect how often I Drink Coffee

#AutomatingMyLifewithPython #tiffintech
Рекомендации по теме
Комментарии
Автор

Thank you. You just gave a glimpse of how object detection works. Kinda thinking of doing something similar in mining industry to detect different kind of rocks and sizes.

edsonwinnerify
Автор

Someone in Indonesia did something like this, using OpenCv to detect sex, age and emotions. Then the door behinds him opened and OpenCv detected a 500-year old angry female ghost. True story.

lkgpuanimho
Автор

i got interest in tech cause of you...and i'm loving the process learing new things !!

KakashiHatake-jlgx
Автор

Pretty Cool Tiffany thanks for Sharing, definitely will be playing around with this. Your such a wealth of knowledge.

espnmk
Автор

Interesting idea for a project!))
You have a problem with testing on video because your white_pixels are not normalized by the size of the face in the camera view (essentially, it doesn’t check the distance between the face and the camera). So, if you are a little further from the camera, white_pixels will be around 8000-9000 or even 5000, if you are a little closer, it can be more than 80, 000.

FlatLine
Автор

Perhaps adding a piece of code that could train the machine to detect different kinds of cup would do the trick. But the cup needs to be detected with open mouth. Cool project Tiff.

kumardigvijaymishra
Автор

Full stack dev moving to Data science (again) and doing honorus in Physics maths. I drank up to 20 cups of coffee at a time. I had to change my diet due to the caffeine causing stomach issues. Keep the coffee and sugar down...

shaunweinberg
Автор

This is why I code to do funny projects 😂😂

Jibril_Abdulkadir
Автор

excellent thank you! you give different view on creating project

TheMetalMag
Автор

one thing i like about you is your sincerity on how you get things done.. awesome..

theophilus
Автор

code review (and maybe video review) suggestion: If you are trying to explain and/or remember what an acronym means and it's in code you are unfamiliar with, write it out. mouth_roi should be mouth_region_of_interest. It may be tricky to put up on screen, but we're not paying by the character in python, so it's better to make it dead stupid to remember what it meant later. Side effect is you don't need to waste video time explaining that to us.

Also, github link?

HeyItsJonSchwartz
Автор

Well done, Tiff! We love when you explore the unknown (to most of us) of AI. This is so exciting and interesting. What a fantastical world we are in. And together is more fun.

aresaurelian
Автор

Hi, I'm from São Paulo! Yeah excellent! ABRAÇO FORTE DE URSO!

moisesespiritosanto
Автор

Did the code confirm that it was coffee in the cup? What if you were drinking whiskey?

chukwuemekailozor
Автор

You have a github repo of code for what you're showing?

WilsonMar
Автор

Cool idea, but it is clear the program is detecting the "white" from the lettering on the coffee mug instead of your teeth, as you have explained. Especially since you are NOT opening your mouth before you lift the mug to... your mouth.😜
How does the code distinguish the difference when you are talking? A better solution might be to have the code identify the "Mug raising" to your mouth. ☕

UberGeek
Автор

Oh, well, I need a cup of Coffee right now!

thgorobets
Автор

I want to see this combined with Pavlok, that way instead of a notification, you would get shocked. Perhaps if someone is trying to quit vaping.

kennethshupe
Автор

Hi Tiffany, please what exactly do you? What's a day life in Tiffany's like?🤣. I think ppl would be very interested. Thanks.

This_World_Aint_For_The_Weak
Автор

I think you are wrong when trying to detect your "open mouth"... 😉
I think it will be more accurate to focus on the cup (of coffee) detection.

LinuxForLife