AI Hands Pose Recognition with Python Tutorial - How to Control Volume with Computer Vision
Vložit
- čas přidán 26. 07. 2024
- Tutorial with Python to control the computer volume, using OpenCV and Mediapipe for computer vision.
00:00 Intro
00:19 Code Base & Logic
05:03 Testing the Code
06:04 Controlling Volume with Hands Gestures
More projects in the channel: bit.ly/3faep9
Guide, Cheat Sheets and eBooks: github.com/rocketingdatascien...
SUPPORT THE CHANNEL
===============================
- FREE: Leave a like in the video
- FREE: Subscribe the channel: bit.ly/3faep9p
Source Code: github.com/rocketingdatascien...
TOP 3 Books for Data Science
===============================
Python for Data Analysis: amzn.to/3sbBany
Hands-On Machine Learning: amzn.to/3P6x49v
Designing Machine Learning Systems: amzn.to/3sfBfGV
My Setup
===============================
Laptop: amzn.to/3qx8ftV
Monitor: amzn.to/3E4nxcw
Headset: amzn.to/3KStTzx
USB Hub: amzn.to/3P1TFny
KEYWORDS
===============================
hand gesture recognition,hand gesture recognition using opencv python,python,gesture recognition,pose estimation python,hand recognition opencv python,action recognition python,real time hand gesture recognition python,mediapipe hand gesture recognition python,real-time hand gesture recognition python,how to make hand gesture recognition using python,hand pose estimation python,mediapipe python tutorial,python machine learning image recognition - Věda a technologie
how does this high quality video only have 9 likes?
That’s great to hear your feedback, thanks
Could you tell me how can i correct my code, as it is showing that , no cv2 module is found
i'd say this is pretty common, if you want something more complex try to add more gestures with a cooldown function in between transition. more of like an encapsulation of gestures
Thank you for your feedback. It is indeed a basic tutorial, to start playing around with these packages. I’m working now in something more interesting regarding computer vision and I’ll share a video about it soon
how do you flip the camera ? to get the mirror image ?
You can use the following: image_rgb=cv2.flip(image_rgb, 1)
Is this what you’re looking for? Did it worked?
How do you autocomplete python imports? What extensions have you used can can you list them please? Thank you
This extension ms-python.python with the pylance (IntelliSense) dependency. Check if you have it
Name: Python
Id: ms-python.python
Description: IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), code formatting, refactoring, unit tests, and more.
Version: 2023.22.1
Publisher: Microsoft
VS Marketplace Link: marketplace.visualstudio.com/items?itemName=ms-python.python
@@RDataScience thank you
what is CV2 from where can i get it?
CV2 is OpenCV: pypi.org/project/opencv-python/
Please put the sorce code in the description. More people will subscribe
I've done it, thank you for warning me. Here it is:
github.com/rocketingdatascience/Volume_Control_with_Hand_Gestures_Recognition
im getting INFO: Created TensorFlow Lite XNNPACK delegate for CPU. when i run the code
Is the webcam window displayed after that message? This is an INFO and should not affect its functionality
@@RDataScience Hi, I got that the same message, laptop's camera light switched to on, but video didn't displayed. Can you give me any tip?
My bad, I didn't know I should move my hands to make the video to be displayed haha
I see, there could be an indentation problem when that happens. But I’m glad to know that you were able to make it work anyway ahah
What does 'mp.solutions' do? since I wanted to test if my imports are working properly using your code but in mine it shows that "solutions" is not an attribute of Mediapipe or "module 'mediapipe' has no attribute 'solutions' '"
Solutions is the method that has already pre-built functions for gesture recognition. In this case, we are calling solutions.hands, for the hands gesture recognition. (It also has solutions.pose for pose use cases for example)
So you imported “mediapipe as mp” correctly since it is saying that mp has no attribute.
Now please verify if “solutions” is correctly spelled, if there isn’t any typo.
If it is correct, uninstall mediapipe and install again. I never faced that problem, but let me know if it worked
@@RDataScience I got it to work as Mediapipe still doesn't support the newer versions of Python, so I just downgraded to Python 3.9.6? and it works, but another issue arises as the code runs but the camera pop up does not show up but the camera light indicating its active, is on. Its just stops at "INFO: Created TensorFlow Lite XNNPACK delegate for CPU"
@@suvarnavikendram.g.5287 Hey, if you wait a little longer it isn't displayed anyway? That is not an error, for me, the camera is displayed a couple of seconds after that INFO being displayed.
Also, test in another py file the code that opens the camera just to degub and understand if that's working
Can we control the brightness..??
Yes you can. With set_brightness() and fade_brightness() from screen_brightness_control package
Will this work on MacOS?
I haven't try, but yes, I believe so. Because from what I see in the docs PyAutoGUI works on MacOS (the remaining packages should too). pyautogui.readthedocs.io/en/latest/index.html
@@RDataScience Oh okay, thanks! I am facing the following error:
line 8, in
hands = mp.hands.Hands(static_image_mode=False, max_numhands=1,
^^^^^^^^
AttributeError: module 'mediapipe' has no attribute 'hands'
You have mp.hands.Hands, replace that first . by a _
Like: mp_hands.Hands
Let me know if that worked
sir unable to install mediapipe in vs code
What’s the error ?
@@RDataScience mediapipe is not avaliable for python 3.12.0
@@RDataScience Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement mediapipe (from versions: none)
ERROR: No matching distribution found for mediapipe
@@user-sg5mt6jj4q mediapipe have some restrictions regarding requirements. Are you using an Apple macOS ?
@@user-sg5mt6jj4q does this help you?
github.com/google/mediapipe/blob/master/docs/getting_started/python.md
es portugues?
Yap
@@RDataScience bem me parecia haha, ta fixe o video, continua mano q vais longe 🔥🔥
Ahahah obrigado mano ! É continuar a melhorar vídeo após vídeo 💪🔥