Тёмный

Sign language detection with Python and Scikit Learn | Landmark detection | Computer vision tutorial 

Computer vision engineer
Подписаться 30 тыс.
Просмотров 114 тыс.
50% 1

In this tutorial we are detecting hand signs with Python, Mediapipe, Opencv and Scikit Learn!
0:00 Intro
1:35 Data collection
4:55 This is the most important thing
11:31 Data processing
27:52 Train model
41:02 Test model
Code: github.com/computervisioneng/...
#computervision #signlanguagedetection #objectdetection #scikitlearn #python #opencv #mediapipe #landmarkdetection

Опубликовано:

 

24 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 347   
@ComputerVisionEngineer
@ComputerVisionEngineer 8 месяцев назад
Did you enjoy this video? Try my premium courses! 😃🙌😊 ● End-To-End Computer Vision: Build and Deploy a Video Summarization API bit.ly/3tyQX0M ● Hands-On Computer Vision in the Cloud: Building an AWS-based Real Time Number Plate Recognition System bit.ly/3RXrE1Y ● Machine Learning Entrepreneur: How to start your entrepreneurial journey as a freelancer and content creator bit.ly/4bFLeaC All my premium courses are available to the Computer Vision Experts in my Patreon. 😉 www.patreon.com/ComputerVisionEngineer
@shwetaevangeline
@shwetaevangeline Месяц назад
Thank you so much, sir for this wonderful project. I've completed my term project easily with the help of your video. Loved how we can create our own data instead of getting it from somewhere else.
@artiste9357
@artiste9357 4 месяца назад
Thanks a lot! I really appreciate keeping this under an hour as well :))
@jesussachez5468
@jesussachez5468 9 месяцев назад
Hello from Mexico! I love your job, I did each step in the same way as you, and I had no difficulties, I really feel very grateful for the time you spent teaching us. Congratulations teacher! 👨‍🏫
@ComputerVisionEngineer
@ComputerVisionEngineer 9 месяцев назад
Thank you! So glad you enjoy the content! 😃🙌
@ITRAiswaryaS
@ITRAiswaryaS Месяц назад
Could you tell me the installation process
@WelcomeToMyLife888
@WelcomeToMyLife888 Год назад
great tutorial on how to organize the project into separate steps!
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Good organization is the key to a successful project I am happy you enjoyed the video! 😄🙌
@emnahamdi-wq4mz
@emnahamdi-wq4mz 7 месяцев назад
Hi! Great tutorial thank you. I have a question: does this program have data augmentation? and did u calculate the sensibility and accuracy of the program?
@1hpxalphaop741
@1hpxalphaop741 Месяц назад
srsly like the best video, now i can train my custom hand gestures etc. even, thank youu❤❤
@thesoftwareguy2183
@thesoftwareguy2183 2 месяца назад
Sir!! You have my respect I have really learned lots of things in your whole video . Just keep making this ML/DL Project videos , that you have done like implementing from scratch any exciting ML/DL project. Just Keep Going Sir!!! Thankyou So much!!✨✨✨✨✨✨❤❤❤❤❤❤
@ComputerVisionEngineer
@ComputerVisionEngineer Месяц назад
Thank you for your support! 😃🙌💪
@febriandewanto2447
@febriandewanto2447 Месяц назад
Thank you, very clear what was taught. I want to ask what if the dataset from a public video had the initial and final movements? whether the start and end frames go into training . and using deep learning?
@kane_jester
@kane_jester 7 месяцев назад
sir , the projects get closed if more hands are placed in the real-time video , i know that randomforest classifier uses only certain features , is there a way so that the program doesnt close if more hands are in the video
@John-xi2im
@John-xi2im Месяц назад
very awesome tutorial with brilliant idea and conceptualization. Thanks a lost Felipe!
@ComputerVisionEngineer
@ComputerVisionEngineer Месяц назад
Thank you for your support! Glad you enjoyed it! 😃🙌
@joque4
@joque4 2 месяца назад
For all who are getting errors like "inhomogeneous shapes" while training on big datasets take into account that the MP Hands processing not always return 42 features (sometimes it just doesn't predict the coordinates well enough). To avoid this situations always check the length of every array. You must have the same amount of images and labels, and the labels (landmark coordinates) should have the same shapes. Just remove the samples that doesn't return all the landmarks or doesn't work well with the Mediapipe hands solution, to ensure all the data has the same shape and to avoid these numpy errors (and bad models).
@RAHUL-dt5xm
@RAHUL-dt5xm Месяц назад
can you help me. when I trained only one gesture nothing else, but the system detects untrained gestures as the trained gesture why? any idea
@user-qm4oc8nb8e
@user-qm4oc8nb8e Месяц назад
can you please share the changed code
@mohamedlhachimi2933
@mohamedlhachimi2933 15 дней назад
i think guys to solve this problem we had to tell the collect data script to save just frames where he could detect our hands else we will store bad models that will ends with this getting errors like "inhomogeneous shapes" , i actually try to solved this problem by not moving my hand when collecting data and making my model else you can try this code to check your images that are stored This script will only print the paths of the images that are deleted due to no hands being detected. It won't display any image windows. ##########################################" import os import cv2 import mediapipe as mp def process_and_show(image_path, mp_drawing): mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Read the image image = cv2.imread(image_path) image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Detect hands and landmarks results = hands.process(image_rgb) if not results.multi_hand_landmarks: print(f"Deleted image: {image_path}") # Delete the image with no hands detected os.remove(image_path) # Path to your data folder containing subfolders data_folder = "data" mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles # Iterate through subfolders for folder_name in os.listdir(data_folder): folder_path = os.path.join(data_folder, folder_name) if os.path.isdir(folder_path): print(f"Checking images in folder: {folder_name}") # Iterate through images in the folder for filename in os.listdir(folder_path): if filename.endswith(".jpg") or filename.endswith(".png"): image_path = os.path.join(folder_path, filename) process_and_show(image_path, mp_drawing)
@user-qm4oc8nb8e
@user-qm4oc8nb8e Месяц назад
Really Thank you sir. Great Project you helped me a lot to learn many things. After multiple errors solving finally i succeeded in making full project.
@ComputerVisionEngineer
@ComputerVisionEngineer Месяц назад
Glad the content is helpful! 😃🙌
@paradisofernando97
@paradisofernando97 8 месяцев назад
i love all that, you are very clearly and simply 😍😍
@ComputerVisionEngineer
@ComputerVisionEngineer 8 месяцев назад
Thank you! Glad you enjoyed it! 😃💪
@sudarsonbharathwaaj1412
@sudarsonbharathwaaj1412 4 месяца назад
Thanks a lot bro, I watched many videos and i wasted a lot of time and finally found your video and done my project.
@ComputerVisionEngineer
@ComputerVisionEngineer 4 месяца назад
You are welcome! Glad it was helpful! 😃
@RohanVector
@RohanVector 3 месяца назад
Please send your github link please
@RohanVector
@RohanVector 3 месяца назад
I got lot of error bro please please please please
@e2mnaturals442
@e2mnaturals442 4 месяца назад
hello from Nigeria i must say thanks for this video it was short, precise and educative yes, i had some errors which i was able to handle due to my past knowledge on Deep Learning. And for those that had issues with the disparity in the length of the data, you can always pad to its maximum length currently, i have a model that can identify 26 classes correctly and i will definitely increase the classes. i made each classes to have 700 images under different lighting condition thanks for all you do.
@ijaspr5486
@ijaspr5486 4 месяца назад
bro can you send me the file for your project
@e2mnaturals442
@e2mnaturals442 4 месяца назад
@@ijaspr5486 like the whole file?
@rarir0012
@rarir0012 25 дней назад
Could you share your GitHub link of your project?
@user-qm4oc8nb8e
@user-qm4oc8nb8e 22 дня назад
@@e2mnaturals442 yes like github code or i give you my social media id
@philipokposo6265
@philipokposo6265 8 месяцев назад
Great content, thank you so much.
@ComputerVisionEngineer
@ComputerVisionEngineer 8 месяцев назад
You are welcome!! 😃
@yaranassar1208
@yaranassar1208 20 дней назад
Hii!! I loved your video. I learned a lot. I just have one question, if at the end I want to form a sentence and print it, how can I save each character on the screen to have a full sentence at the end?
@000HASNAIN_AHMED
@000HASNAIN_AHMED 7 месяцев назад
Thank you sir for this video
@prithvisingh2851
@prithvisingh2851 6 месяцев назад
I have trained my model using only numbers' data. It is working but the problem is it is only showing the numbers 9 or 1 in the frame. Do you think it's because of unclear data or problem in the training model. BTW great tutorial 👍
@senpaihere6512
@senpaihere6512 2 месяца назад
hehe subscribed, tysm for this it was very helpful
@abdulbarisoylemez2817
@abdulbarisoylemez2817 7 месяцев назад
thank you my teacher, great a video , i tried it myself, I did it :)
@ComputerVisionEngineer
@ComputerVisionEngineer 7 месяцев назад
You are welcome! 😃 Glad you enjoyed it!! 🙂🙌
@nilayguler8397
@nilayguler8397 2 месяца назад
Thanks a lot! I really appreciate keeping this under an hour as well :)) We are trying to implement this model in Flutter to develop a mobile app. How can we create Flutter integration ?
@livelife846
@livelife846 6 месяцев назад
Thank you so much it's helpful for me 😊
@ComputerVisionEngineer
@ComputerVisionEngineer 6 месяцев назад
Glad to hear it is helpful! 😃🙌
@RohanVector
@RohanVector 3 месяца назад
size.width>0 && size.height>0 in function 'cv::imshow' error sir
@LEDAT-AI
@LEDAT-AI 11 месяцев назад
Hello, I have watched your video and found it very informative. However, I was wondering if you could make a video for recognizing different characters for a sequence of movements, for example, the letter "J" or "Z." Thank you for your video.
@ComputerVisionEngineer
@ComputerVisionEngineer 11 месяцев назад
I will try to. 🙌
@arifemreyaman2150
@arifemreyaman2150 Год назад
another great project
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Thank you, Arif! I am happy you enjoyed it. 😃🙌
@ranjanadevi7965
@ranjanadevi7965 3 месяца назад
Hello while executing your codes when i was keeping the number of objects grater than 4 thn trainclassifier was unable to generate model.p file in my device can you help me out to solve this issue
@yusufcan1304
@yusufcan1304 День назад
Thanks man
@harshasshet6755
@harshasshet6755 Месяц назад
I am getting plots for every data set size which i have taken is it fine bcs i have plt.savefig function, annotated it so that the plt for every dataset size is saved in main data directory
@frankleonardoluquelineros9389
@frankleonardoluquelineros9389 7 месяцев назад
Really great video tutorial! Why did you choose scikt learn and not Yolo? How many changes would you have to make to use Yolo?
@ComputerVisionEngineer
@ComputerVisionEngineer 7 месяцев назад
Do you mean using Yolo for object detection instead of mediapipe + Scikit learn? It can be done. You just need to train it. I did it with mediapipe + Scikit learn only for simplicity, and I think it also results in a more robust classifier. 🙌
@hayatlr3000
@hayatlr3000 Год назад
great tutorial so helpful for my pfe project i actually have to do hand recognition identification biometric only but the hand contour you explained so well the part "this is the most important thing" and I really need help when it comes to the approach of how i can solve this if it? is possible for you to help me by doing a video of it ?cause its the first time for me working with python i usually work with Matlab. thank you again for this video
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey Hayat, I am glad you found it helpful! 😄 Do you mean making a video about how to be strategic when starting a project and choose the most promising approach? Sure, I can do a video about problem solving strategies! 😃🙌
@luongtranle2979
@luongtranle2979 Год назад
Do you have file word report ?
@CanalIFES
@CanalIFES Год назад
why do you use and random forest classifier algorithm? maybe it is better for it? could i try with a pretrained model to get better results?
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
No particular reason why I used a Random Forest, I think pretty much any other classifier would have a similar performance in this case.
@CanalIFES
@CanalIFES Год назад
@@ComputerVisionEngineer Thanks felipe!!
@zeroboom4
@zeroboom4 2 месяца назад
I have tried it with arabic Sign language,and it did not working correctly, I get one letter almost every time and it's wrong letter, any ideas that can help me train the model. I got the dataset from kaggle.
@jeet611_
@jeet611_ 7 месяцев назад
life saver.
@sandanuwan4441
@sandanuwan4441 2 месяца назад
I am new to AI. I just want to know are we using Natural Language, Machine Learning and computer vision.
@dinithnisal643
@dinithnisal643 9 месяцев назад
hello Sir, I follow your video for learning about computer vision . So I have a trouble with "DATA_DIR = './data'" , Is this file need to import from somewhere or should we need to prepare them? Can you help me to solve this?
@peterbarasa9190
@peterbarasa9190 7 месяцев назад
am also thinking the same. The images seem no to be there
@georgevalentin9483
@georgevalentin9483 Год назад
I checked the github repo and there are some changes compared to the video. Why are you substracting the min of x_ from x (data_aux.append(x - min(x_))), also for y ? Why is it necessary to do that instead of just append x the way it is to the array. I saw u did that in the data processing and also in the model testing. Thanks a lot!
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey George! Yeah, I sent that change in a new commit. It makes the solution more robust, you could think about it as a way of 'normalization'. This makes the classifier learn better than the (x, y) position of each landmark is not that important, the distance of each landmark to each other landmark is what matters most! 😃💪
@georgevalentin9483
@georgevalentin9483 Год назад
@@ComputerVisionEngineer Thanks a lot for the answer! I thought it has something to do with the mediapipe library and is a must, but it actually makes sense to be some kind of normalization. Thanks for you time!
@miladsayedi59
@miladsayedi59 19 дней назад
can we make this project with pose detection models like openpose or deeppose? and what is the difference
@fragileaf1778
@fragileaf1778 3 месяца назад
The camera crashes when I show more than one hand. Can you tell me how it can be fixed?
@mahmudsherbhai2325
@mahmudsherbhai2325 9 месяцев назад
hi I am a 15 year old and i want to do this for my school tech convention. What program are you using to code this
@martinsilungwe2725
@martinsilungwe2725 Год назад
I have just subscribed, Currently working on a similar project, fingers crossed I'm at a right place..😂
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
🤞😀 Good luck with your project, Martin! 🙌
@martinsilungwe2725
@martinsilungwe2725 Год назад
@@ComputerVisionEngineer Sir i have an error "ValueError: The least populated class in y has only 1 member, which is too few. The minimum number of groups for any class cannot be less than 2. ", what can be the problem, im trying to classfy all the alphabet letters, your help will be highly appreciated.
@vamsianurag3415
@vamsianurag3415 Год назад
Hi, while going through this code i'm getting model_dict = pickle.load(open('./model.p', 'rb')) FileNotFoundError: [Errno 2] No such file or directory: './model.p' and I didn't find any model.p file in your repository
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey, you can create the model yourself following the steps I describe in the video. 😃🙌
@MrFurious0007
@MrFurious0007 7 месяцев назад
Hello , great tutorial 😀can this same approach be applied for british sign language because that uses both hands to make gestures , also can this be deployed in the real world and used at production level ?
@ComputerVisionEngineer
@ComputerVisionEngineer 7 месяцев назад
You would need to make some edits in order to use it with both hands but I guess it would work, yes. Regarding the performance, yeah you could train it and improve it so it can be used at a production level. 🙌
@MrFurious0007
@MrFurious0007 7 месяцев назад
thanks @@ComputerVisionEngineer 😁i'll try and see if it works out
@MrFurious0007
@MrFurious0007 7 месяцев назад
Hey @@ComputerVisionEngineer , its not working efficiently for the british sign lang , maybe because it uses both hands , do you have any suggestions on how i can build up my project , it'll be a huge help , thanks
@user-mw3cd3eu7w
@user-mw3cd3eu7w 2 месяца назад
Great Video
@RohanVector
@RohanVector 3 месяца назад
Some hand sign have two hand ,than what we can do that situation ?
@rutujakothale3829
@rutujakothale3829 Месяц назад
i'm getting this error, please help Traceback (most recent call last): File "d:\sign lang\testing.py", line 27, in H, W, _ = frame.shape AttributeError: 'NoneType' object has no attribute 'shape' INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
@iantang2048
@iantang2048 7 месяцев назад
Hi sir, Thanks for your tutorial. Yet, I a problem in locating the file(./data), and received an error message of [Errno 20] Not a directory: './data/.DS_Store'. while using "create_dataset.py". Currently all file are put in desktop, do you know why? (I m using MacBook)
@gXLg
@gXLg 7 месяцев назад
The thing about Apple is that MacOS often puts a file called ".DS_Store" in the directory which stores some information. In your code where you iterate over folders, compare the name with ".DS_Store" and simply skip it
@lolalikee
@lolalikee 7 месяцев назад
Can the project created by exported to an .exe? Im worried because of the pickle file.
@martinsilungwe2725
@martinsilungwe2725 Год назад
Is there a way that we can contact you apart, from the comments section, because I really need your help on the splitting of the datasets, I have followed every step in the tutorial but to no avail, it it not working for me.... The part were you are splitting the data to training set and test set, to be specific
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
You may try to contact me in our discord.
@makiizenin
@makiizenin 9 месяцев назад
Hello sir, I got a one problem. I made the same with you and my code is worked but it only showed at least 5 mins for capturing then the camera will shutdown automatically and got some errors. :((((
@prathamupadhyay1265
@prathamupadhyay1265 Год назад
How can I get accuracy for the letters predicted? Basically I want live accuracy for the letters that are predicted , since if you show any random hand gesture it will always predict some random letter, so it will be much better if you could also show live accuracy .Is it possible can u guide me a little bit through this?
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Try using the method 'predict_proba' instead of 'predict'. You wil get a probability vector for all the classes. Taking the largest number will give you the confidence value you are looking for. 💪💪
@prathamupadhyay1265
@prathamupadhyay1265 Год назад
@@ComputerVisionEngineer Thanks a lot you are amazing !!! 😃
@yashanchule9641
@yashanchule9641 Год назад
@@prathamupadhyay1265 bhai if u dont mind kya app apke code ki zip file mujhe share kar skte hai, coz im getting many errors and i have tried many steps but kuch ho nahi raha hai. PLZ!!!!!!
@yashanchule9641
@yashanchule9641 Год назад
plz bhai
@054_vishwadhimar4
@054_vishwadhimar4 10 месяцев назад
@@yashanchule9641 GitHub link is there..or have you tried that too?!
@VnZR_
@VnZR_ 6 месяцев назад
Hi... Since many signs involve some type of movement, I wonder if videos could be used in place of pictures. I hope you can reply to me because your video is very helpful for us. Thanks in advance.
@ComputerVisionEngineer
@ComputerVisionEngineer 6 месяцев назад
Yes, you could try with video classification. 🙌
@user-sj7fm1jc3z
@user-sj7fm1jc3z 5 месяцев назад
Hello, i was adding new alphabets to the dataset and got this error , unable to solve : " File "D:\Major project\.Major Project\code\train_classifier.py", line 11, in data = np.asarray(data_dict['data']) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (400,) + inhomogeneous part."
@tvrtkokaurinovic7370
@tvrtkokaurinovic7370 4 месяца назад
did you fix this error?
@abdallahsamir2707
@abdallahsamir2707 10 месяцев назад
Hello, I have watched your video and found it very informative. However, I was wondering what is the limitation of this project?
@ComputerVisionEngineer
@ComputerVisionEngineer 10 месяцев назад
Hey, limitation in terms of possible symbols? I would say any static symbol made with only one hand.
@foru1854
@foru1854 7 месяцев назад
hey its does not work for more than 5 sign can show value error about the shape can you please fix it
@yashanchule9641
@yashanchule9641 Год назад
Cant we get any tflite file from this model ?
@mariamartinez4860
@mariamartinez4860 6 месяцев назад
why does it close when you put another hand?
@adn4779
@adn4779 3 месяца назад
@ComputerVisionEngineer ValueError: X has 84 features, but RandomForestClassifier is expecting 42 features as input..I am getting this error when i run the inference_clasifier.py model...What change should i make in the code.....
@shwetaevangeline
@shwetaevangeline Месяц назад
If you're getting this, that means you're showing something else that isn't in the data. Only show what you've captured. Or else simply increase number of classes and take different pictures from different angles.
@mohamedlhachimi2933
@mohamedlhachimi2933 15 дней назад
i think guys to solve this problem we had to tell the collect data script to save just frames where he could detect our hands else we will store bad models that will ends with this getting errors like "inhomogeneous shapes" , i actually try to solved this problem by not moving my hand when collecting data and making my model else you can try this code to check your images that are stored This script will only print the paths of the images that are deleted due to no hands being detected. It won't display any image windows. ##########################################" import os import cv2 import mediapipe as mp def process_and_show(image_path, mp_drawing): mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Read the image image = cv2.imread(image_path) image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Detect hands and landmarks results = hands.process(image_rgb) if not results.multi_hand_landmarks: print(f"Deleted image: {image_path}") # Delete the image with no hands detected os.remove(image_path) # Path to your data folder containing subfolders data_folder = "data" mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles # Iterate through subfolders for folder_name in os.listdir(data_folder): folder_path = os.path.join(data_folder, folder_name) if os.path.isdir(folder_path): print(f"Checking images in folder: {folder_name}") # Iterate through images in the folder for filename in os.listdir(folder_path): if filename.endswith(".jpg") or filename.endswith(".png"): image_path = os.path.join(folder_path, filename) process_and_show(image_path, mp_drawing)
@duleamihai2202
@duleamihai2202 7 месяцев назад
For those who faces the error where it can't convert the 'data' values from dictionary data_dict, just make sure that in photo samples you are giving the full hand because if not, there will be inconsistent data and the lists will not have the same lenght inside the data_dict['data']. Do again the photos retrieve part and all should be fine
@artiste9357
@artiste9357 4 месяца назад
Thanks a lot!! How did you notice that this was the issue?
@saivaraprasadmandala8558
@saivaraprasadmandala8558 3 месяца назад
thanks a lot bro!!!
@livelife846
@livelife846 6 месяцев назад
Who can I add more sign because it's getting error when I try to add more signs
@jonrexzelvalloyas6294
@jonrexzelvalloyas6294 Год назад
great project! may i ask what algorithm is used in your sign language?
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey, thank you! I am using mediapipe as a hand detector and landmark detector and a Random Forest classifier as sign classifier. 🙌
@septian5761
@septian5761 16 дней назад
can i ask how can you moved this into mobile / android studio
@locphan1221
@locphan1221 11 месяцев назад
thanks
@054_vishwadhimar4
@054_vishwadhimar4 10 месяцев назад
did you use any particular research paper for this project. i have to make a report for my project and cite a reference and it would help if you can tell me which one you used or which one will be the most similar to this project.
@ComputerVisionEngineer
@ComputerVisionEngineer 10 месяцев назад
Hey, I didn't use any research paper for this project. 🙌
@054_vishwadhimar4
@054_vishwadhimar4 10 месяцев назад
@@ComputerVisionEngineer alright then...but do you have any idea which one would be similar or near to this?
@aakritityagi7203
@aakritityagi7203 9 месяцев назад
@@054_vishwadhimar4 hi, did you get the research paper?
@054_vishwadhimar4
@054_vishwadhimar4 9 месяцев назад
@@aakritityagi7203 no I did not actually... thankfully my mentor did not force me to find one and accepted multiple youtube.videos as references
@daisybristow7036
@daisybristow7036 Год назад
Hi, I wondered how this would work if you had text files for each image, which held the class information and the bounding box coordinates (top left and bottom right), kinda like the YOLO format txt files?
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey, yeah I think that would work for a video for example, where you have already computed the object detection and classification for that video beforehand. If you are detecting objects live, in a webcam, you would need an object detector and an image classifier. I don't think you could load the annotations from a txt file in yolo fomat because you are capturing the data live. 💪💪
@daisybristow7036
@daisybristow7036 Год назад
@@ComputerVisionEngineer Thank you for your response! I may have made my last comment a bit confusing. Basically, I am trying to adapt this code to eliminate the media pipe elements. I already have a dataset of still images and corresponding text files holding the bounding box coordinates. I am using scikit to train still. But I keep getting errors when i run the training script. Your help would be much appreciated
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
@daisybristow7036 oh I see, yes sure you could use something like yolov8 and replace both mediapipe and Scikit learn. Once you collected the data, you can just train yolov8 following the steps in my video on how to train yolov8 on a custom dataset. Then, for inference, take a look at my video on object detection + tracking. 🙌
@daisybristow7036
@daisybristow7036 Год назад
@@ComputerVisionEngineer This would be an optimal solution, however I am required to use scikit to train not yolo. Would it be ok if I could explain it further beyond the comment section of this video? 😵‍💫
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
@@daisybristow7036 you could use both Scikit learn and yolov8, so you use Scikit learn to validate the class you got with yolov8, that would be a super robust solution! 😃 I may create a discord or something similar later on, for now it is only the comments section of my videos.
@sourabhchandra1740
@sourabhchandra1740 Год назад
Hlo Sir, very nice video.... I also want to make a similar project ... But there will a bit difference.. I want to generate the entire subtitle for people who can't speak using their hand gestures during video conferencing in real time. Can you please guide me with the same ... Bcoz I completely a beginner. Your help will be appreciated. Thanks in advance. 😀
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey Sourabh, it sounds like a complex and very cool project! I would start by saving all the symbols you detect, its confidence score, and the duration of time you detect them so you can analyze this info later on. This is going to help you to understand the problem a little better and also it is going to help you to define rules in order to achieve your goal. 😃💪
@Abhaykumar-bu7ei
@Abhaykumar-bu7ei 7 месяцев назад
Hi Sourabh were you able to make it if yes could you please share some update or code for the same
@hamzak2883
@hamzak2883 Год назад
First of all i want to thank you for this tutorial. I want actually to make a program for sign language but i am confused about the Dataset and how to process the Data which i will maybe get as Videos or Images. can you maybe give me some advice.
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Sure. Do you think you can take an approach as I do in the video?
@bdtamilgamers8083
@bdtamilgamers8083 8 месяцев назад
Sir only 9 character can be trained plz help me to train 26 character
@travisfernandes5387
@travisfernandes5387 Месяц назад
how to make this project on web based like on react or flask
@mdemike1781
@mdemike1781 5 месяцев назад
If you train it in a specific place ex: your bedroom would this work like with the background of your kitchen or different place?
@ComputerVisionEngineer
@ComputerVisionEngineer 5 месяцев назад
Yes, by the way we are doing it in this tutorial, it should work if you change the background. 🙌
@mohamedlhachimi2933
@mohamedlhachimi2933 15 дней назад
@@ComputerVisionEngineer i think guys to solve this problem we had to tell the collect data script to save just frames where he could detect our hands else we will store bad models that will ends with this getting errors like "inhomogeneous shapes" , i actually try to solved this problem by not moving my hand when collecting data and making my model else you can try this code to check your images that are stored This script will only print the paths of the images that are deleted due to no hands being detected. It won't display any image windows. ##########################################" import os import cv2 import mediapipe as mp def process_and_show(image_path, mp_drawing): mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Read the image image = cv2.imread(image_path) image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Detect hands and landmarks results = hands.process(image_rgb) if not results.multi_hand_landmarks: print(f"Deleted image: {image_path}") # Delete the image with no hands detected os.remove(image_path) # Path to your data folder containing subfolders data_folder = "data" mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles # Iterate through subfolders for folder_name in os.listdir(data_folder): folder_path = os.path.join(data_folder, folder_name) if os.path.isdir(folder_path): print(f"Checking images in folder: {folder_name}") # Iterate through images in the folder for filename in os.listdir(folder_path): if filename.endswith(".jpg") or filename.endswith(".png"): image_path = os.path.join(folder_path, filename) process_and_show(image_path, mp_drawing)
@rohitchan007
@rohitchan007 Год назад
Thank you for the video, can you also make a video on sign language recognition on a video dataset (Word level american sign language dataset).
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
You are welcome! I will try to make a video about it. 🙌
@oterotube13
@oterotube13 9 месяцев назад
help!: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (7960,) + inhomogeneous part. Need to something to remove the bad part from the pickle file.
@user-mh6ek3hv3k
@user-mh6ek3hv3k 8 месяцев назад
hello I am having the same problem. Could be share your solution if you find one. Thank you!
@mohamedlhachimi2933
@mohamedlhachimi2933 15 дней назад
i think guys to solve this problem we had to tell the collect data script to save just frames where he could detect our hands else we will store bad models that will ends with this getting errors like "inhomogeneous shapes" , i actually try to solved this problem by not moving my hand when collecting data and making my model else you can try this code to check your images that are stored This script will only print the paths of the images that are deleted due to no hands being detected. It won't display any image windows. ##########################################" import os import cv2 import mediapipe as mp def process_and_show(image_path, mp_drawing): mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Read the image image = cv2.imread(image_path) image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Detect hands and landmarks results = hands.process(image_rgb) if not results.multi_hand_landmarks: print(f"Deleted image: {image_path}") # Delete the image with no hands detected os.remove(image_path) # Path to your data folder containing subfolders data_folder = "data" mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles # Iterate through subfolders for folder_name in os.listdir(data_folder): folder_path = os.path.join(data_folder, folder_name) if os.path.isdir(folder_path): print(f"Checking images in folder: {folder_name}") # Iterate through images in the folder for filename in os.listdir(folder_path): if filename.endswith(".jpg") or filename.endswith(".png"): image_path = os.path.join(folder_path, filename) process_and_show(image_path, mp_drawing)
@ShivamKumar-oj4zp
@ShivamKumar-oj4zp Год назад
Just wanted to tell you that your project is very famous in SMIT 😊
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
😃 That is soooo cool! I am happy to help you guys. 😊🙌
@martinsilungwe2725
@martinsilungwe2725 Год назад
Have you manage to Train the model with all alphabet letters
@Hatakeutd
@Hatakeutd 9 месяцев назад
How will this accept video feed from a phone ?
@user-xb5vh5um7d
@user-xb5vh5um7d Год назад
Hi, I am getting an error that ./data/.DS_Store is not a directory and is not found.
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey, what file / line triggers this error?
@texsesyt2902
@texsesyt2902 Год назад
hello sir i am getting this error ValueError: The least populated class in y has only 1 member, which is too few. The minimum number of groups for any class cannot be less than 2. x_train, x_test, y_train, y_test = train_test_split(data, labels, test_size=0.2, shuffle=True, stratify=labels) i observe that if i remove stratify i donot get error but after that i get 0.0% of samples were classified correctly !
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey, how many different symbols are you trying to classify? How did you collect the data for each symbol?
@texsesyt2902
@texsesyt2902 Год назад
@@ComputerVisionEngineer I change number_of_classes to 5 and i collect data through opencv by capturing images(by using the method describe in this video) Note: python version 3.11.2
@texsesyt2902
@texsesyt2902 Год назад
total 5 symbols each got 0 to 99 images
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
There is a probably a bug with the data. Take a look at 'labels', how many elements are there for the different classes? Is it an array of integers or is it other data type?
@texsesyt2902
@texsesyt2902 Год назад
@@ComputerVisionEngineer Now i am getting this error when i make 25 classes(for each alphabet). data = np.asarray(data_dict['data']) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2471,) + inhomogeneous part.
@luongtranle2979
@luongtranle2979 Год назад
May I ask you the report about this project ?
@saivaraprasadmandala8558
@saivaraprasadmandala8558 3 месяца назад
Error: Traceback (most recent call last): File "h:\Mini Project\Mallikarjun Project\sign-language-detector-python-master\sign-language-detector-python-master\inference_classifier.py", line 7, in model_dict = pickle.load(open('./model.p', 'rb')) ^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: './model.p' Could u help me out in fixing this error sir!!!!.
@kyrohuh728
@kyrohuh728 8 месяцев назад
when you crop the image to just show the sign does that mean anyone can sign the alphabet and it will show what sign they are doing?
@ComputerVisionEngineer
@ComputerVisionEngineer 7 месяцев назад
Once the model is trained, anyone can sign the alphabet and it will show what sign they are doing.
@saurabhmishra7487
@saurabhmishra7487 6 дней назад
The app crashes when using both hands. How can I fix this?
@jainishshah2021
@jainishshah2021 Год назад
Can anyone help me out with the error, I am facing the error in the sign language detection tutorial in the train_classifier section data = np.asarray(data_dict['data']) TypeError: float() argument must be a string or a real number, not 'list' ValueError: setting an array element with a sequence.
@lal6797
@lal6797 Год назад
Did you solve this error??
@RohitSharma-mj9fz
@RohitSharma-mj9fz 11 месяцев назад
@@lal6797 if you have solution please inform me
@michaenrangelgiraldo5428
@michaenrangelgiraldo5428 10 месяцев назад
Hello, thank u for tutorial, that was amazing but i have an error when y run the classifier: ValueError: X has 42 features, but RandomForestClassifier is expecting 84 features as input. how can i fix that error?
@uzairkabeer
@uzairkabeer 10 месяцев назад
@michaenrangelgiraldo5428 Okay so, I'm assuming that you are getting this error when predicting for that I just put an if condition like: if (len(data_aux) != 84) And with in that if condition I predict the values. I myself don't know whats causing this error but my assumption is it has something to do with the both left and right hand landmarks (42+42=84). Nevertheless, this solves this issue hope it will help you too.
@alexday4949
@alexday4949 9 месяцев назад
Can you try this code: desired_length = 4200 # Pad data_aux with zeros to achieve the desired length while len(data_aux) < desired_length: data_aux.extend([0.0, 0.0]) # Truncate data_aux if it exceeds the desired length data_aux = data_aux[:desired_length]
@mohamedlhachimi2933
@mohamedlhachimi2933 15 дней назад
i think guys to solve this problem we had to tell the collect data script to save just frames where he could detect our hands else we will store bad models that will ends with this getting errors like "inhomogeneous shapes" , i actually try to solved this problem by not moving my hand when collecting data and making my model else you can try this code to check your images that are stored This script will only print the paths of the images that are deleted due to no hands being detected. It won't display any image windows. ##########################################" import os import cv2 import mediapipe as mp def process_and_show(image_path, mp_drawing): mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Read the image image = cv2.imread(image_path) image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Detect hands and landmarks results = hands.process(image_rgb) if not results.multi_hand_landmarks: print(f"Deleted image: {image_path}") # Delete the image with no hands detected os.remove(image_path) # Path to your data folder containing subfolders data_folder = "data" mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles # Iterate through subfolders for folder_name in os.listdir(data_folder): folder_path = os.path.join(data_folder, folder_name) if os.path.isdir(folder_path): print(f"Checking images in folder: {folder_name}") # Iterate through images in the folder for filename in os.listdir(folder_path): if filename.endswith(".jpg") or filename.endswith(".png"): image_path = os.path.join(folder_path, filename) process_and_show(image_path, mp_drawing)
@user-mh6ek3hv3k
@user-mh6ek3hv3k 8 месяцев назад
Hello! I tried to do exactly what you did but using the 26 alphabets. I don't know where I went wrong but the data list when converted to an nparray is giving me this error: ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2581,) + inhomogeneous part. I have so many things but I am utterly stuck. Please do you have any idea on how I can fix this error.
@ComputerVisionEngineer
@ComputerVisionEngineer 8 месяцев назад
Hey, not sure what could be going on, although it is always a good practice to take projects one step at the time. Try to do it with only 2 or 3 symbols and work your way up. It will make things easier to debug. 😃🙌
@user-mh6ek3hv3k
@user-mh6ek3hv3k 8 месяцев назад
@@ComputerVisionEngineer Thank you. I took your advice and was able to fix the problem by breaking it down. Turns out the data for 3 letters were not properly captured but I re captured them and the 26 letters are working perfectly!! Thank you.
@ComputerVisionEngineer
@ComputerVisionEngineer 8 месяцев назад
@@user-mh6ek3hv3k Amazing! Happy to hear you solved the problem! 😃
@foru1854
@foru1854 7 месяцев назад
@@user-mh6ek3hv3k i am actually also facing the same error how can i identify which letter data is not captured correctly? pls can you tell me
@user-mh6ek3hv3k
@user-mh6ek3hv3k 7 месяцев назад
@@foru1854 What I did was start with the first letter (A) , did carried out all the steps and trained the model. When I saw it worked, I added the second letter and did the two; then the third and that gave me the error so I knew the third had a problem and recaptured. I followed on like that and when I add a new one and I get the error I will know that alphabet needs to be recaptured. Hope that helps
@essiebx
@essiebx 7 месяцев назад
doesnt this work when you use labeled dataset
@Om-id1qr
@Om-id1qr Год назад
Great tutorial! Can you tell me how can I do this for Indian Sign Language which uses 2 hands?
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
I am looking at the Indian sign language alphabet and I see some characters are done with 2 hands and others with 1 hand. In order to do something based on landmarks as we did on this video you would have to train 2 classifiers, one of them taking as input the landmarks of one hand only (as we did on the video) and the other classifier taking as input the landmarks of both hands. Then some logic to apply one classifier or the other one depending on how many hands appear on the frame. Or, you can just follow a different approach and train an image classifier taking the crop of the hand/s. 💪🙌
@v5j7bxb
@v5j7bxb 27 дней назад
Hi ! Have you completed working on this project? Did it worked ?
@ocelottes
@ocelottes 10 месяцев назад
Very cool, i have a question. How can i test de accuracy of the detection?
@ComputerVisionEngineer
@ComputerVisionEngineer 10 месяцев назад
Do you mean the accuracy of the hand detection?
@ocelottes
@ocelottes 10 месяцев назад
@@ComputerVisionEngineer yes
@ComputerVisionEngineer
@ComputerVisionEngineer 10 месяцев назад
@@ocelottes it is mediapipe hand detection, if you want to test it's accuracy you would need to take another hand detector to compare mediapipe detections against
@MEGHAJJADHAV
@MEGHAJJADHAV 7 месяцев назад
How can we make a confusion matrix for the model that was made?
@e2mnaturals442
@e2mnaturals442 4 месяца назад
hi were you able to solve this? i used import matplotlib.pyplot as plt import seaborn as sns # class names class_names = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] # Plot the confusion matrix plt.figure(figsize=(15, 15)) sns.heatmap(conf_matrix, annot=True, fmt='d', cmap='Blues', xticklabels=class_names, yticklabels=class_names) plt.title('Confusion Matrix') plt.xlabel('Predicted') plt.ylabel('True') plt.show()
@tihbohsyednap8644
@tihbohsyednap8644 Год назад
Sir kindly help me with this error . . ValueError: The least populated class in y has only 1 member, which is too few. The minimum number of groups for any class cannot be less than 2.
@tihbohsyednap8644
@tihbohsyednap8644 Год назад
Sir kindly help me with this error. I am working on this project as my final year project and I have to extend it as my major project work.
@mohamedlhachimi2933
@mohamedlhachimi2933 15 дней назад
i think guys to solve this problem we had to tell the collect data script to save just frames where he could detect our hands else we will store bad models that will ends with this getting errors like "inhomogeneous shapes" , i actually try to solved this problem by not moving my hand when collecting data and making my model else you can try this code to check your images that are stored This script will only print the paths of the images that are deleted due to no hands being detected. It won't display any image windows. ##########################################" import os import cv2 import mediapipe as mp def process_and_show(image_path, mp_drawing): mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Read the image image = cv2.imread(image_path) image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Detect hands and landmarks results = hands.process(image_rgb) if not results.multi_hand_landmarks: print(f"Deleted image: {image_path}") # Delete the image with no hands detected os.remove(image_path) # Path to your data folder containing subfolders data_folder = "data" mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles # Iterate through subfolders for folder_name in os.listdir(data_folder): folder_path = os.path.join(data_folder, folder_name) if os.path.isdir(folder_path): print(f"Checking images in folder: {folder_name}") # Iterate through images in the folder for filename in os.listdir(folder_path): if filename.endswith(".jpg") or filename.endswith(".png"): image_path = os.path.join(folder_path, filename) process_and_show(image_path, mp_drawing)
@sherwingeorge6959
@sherwingeorge6959 7 месяцев назад
What python version have you used in this project?
@ComputerVisionEngineer
@ComputerVisionEngineer 7 месяцев назад
Python 3.7 if not mistaken
@tam1k.
@tam1k. Год назад
Hello, first and formost . Thank you for helping me with this fun project! Second , ive stumbled in an error while typing "import matplotlib.pyplot as plt" as in Problems it says that "No module named 'pyplot' " Please help
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey, have you installed the project requirements?
@tam1k.
@tam1k. Год назад
@@ComputerVisionEngineer yes, even the specific versions
@ahanatola6522
@ahanatola6522 3 месяца назад
Can anybody please tell using this same process can we create it for all 26 alphabet
@kiranmahapatra8716
@kiranmahapatra8716 8 месяцев назад
Sir please help............during training it shows value error..data = np.asarray(data_dict['data']) ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (199,) + inhomogeneous part......for 3 class
@SohamKaranjkar
@SohamKaranjkar 5 месяцев назад
i got the same error, were you able to solve it?
@krzysztofgalek5276
@krzysztofgalek5276 4 месяца назад
Did u solve it?
@e2mnaturals442
@e2mnaturals442 4 месяца назад
i was able to sort it using padding if you want me to explain more, i will be glad to
@Elenas1178
@Elenas1178 3 месяца назад
@@e2mnaturals442 please explain
@assassinhi4889
@assassinhi4889 2 месяца назад
it's showing the error: ValueError: setting an array element with a sequence. after loading the dictionary in the model.
@mohamedlhachimi2933
@mohamedlhachimi2933 15 дней назад
i think guys to solve this problem we had to tell the collect data script to save just frames where he could detect our hands else we will store bad models that will ends with this getting errors like "inhomogeneous shapes" , i actually try to solved this problem by not moving my hand when collecting data and making my model else you can try this code to check your images that are stored This script will only print the paths of the images that are deleted due to no hands being detected. It won't display any image windows. ##########################################" import os import cv2 import mediapipe as mp def process_and_show(image_path, mp_drawing): mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Read the image image = cv2.imread(image_path) image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Detect hands and landmarks results = hands.process(image_rgb) if not results.multi_hand_landmarks: print(f"Deleted image: {image_path}") # Delete the image with no hands detected os.remove(image_path) # Path to your data folder containing subfolders data_folder = "data" mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles # Iterate through subfolders for folder_name in os.listdir(data_folder): folder_path = os.path.join(data_folder, folder_name) if os.path.isdir(folder_path): print(f"Checking images in folder: {folder_name}") # Iterate through images in the folder for filename in os.listdir(folder_path): if filename.endswith(".jpg") or filename.endswith(".png"): image_path = os.path.join(folder_path, filename) process_and_show(image_path, mp_drawing)
@touchwood8404
@touchwood8404 Месяц назад
The mediapipe library is giving error in installation what should I do?
@fruitpnchsmuraiG
@fruitpnchsmuraiG Месяц назад
did you figure it out?
@legion4924
@legion4924 Год назад
Hello sir, in this project can uses for 2 hands?
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
Hey, yeah sure the project can be adapted for 2 hands. 🙌
@legion4924
@legion4924 Год назад
@@ComputerVisionEngineer okay sir thank u🙏
@swagatbaruah522
@swagatbaruah522 10 месяцев назад
EVERYTHING IS WORKING FINE, EXCEPT FOR THE FACT THAT THE MY FINAL PROGRAM IS UNABLE TO RECOGNIZE ANY SIGN. IT JUST GIVE EVERY SIGN THE SAME LABEL WHATEVER THERE IS IN THE INDEX 0 OF THE LABEL LIST. I don't understand why its not working???
@tvrtkokaurinovic7370
@tvrtkokaurinovic7370 4 месяца назад
same here, did you fix it?
@chinmayyxd
@chinmayyxd Год назад
Hi @computervisionengineer i was just doing the project from one of your youtube video and the error i was getting was "X has 42 features, but RandomForestClassifier is expecting 84 features as input." My question is how to modify code so that it recognises both of the hands. THANKS!
@ComputerVisionEngineer
@ComputerVisionEngineer Год назад
If you trained the model using 2 hands, the issue may be that the in inference the model capture only one hand in a frame and that triggers the error. You could add an if statement to only run the inference if 2 hands were detected.
@abhisheknegi7608
@abhisheknegi7608 6 месяцев назад
Can you please write the modified code?
@e2mnaturals442
@e2mnaturals442 4 месяца назад
i used padding to sort this out
@mohamedlhachimi2933
@mohamedlhachimi2933 15 дней назад
i think guys to solve this problem we had to tell the collect data script to save just frames where he could detect our hands else we will store bad models that will ends with this getting errors like "inhomogeneous shapes" , i actually try to solved this problem by not moving my hand when collecting data and making my model else you can try this code to check your images that are stored This script will only print the paths of the images that are deleted due to no hands being detected. It won't display any image windows. ##########################################" import os import cv2 import mediapipe as mp def process_and_show(image_path, mp_drawing): mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Read the image image = cv2.imread(image_path) image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Detect hands and landmarks results = hands.process(image_rgb) if not results.multi_hand_landmarks: print(f"Deleted image: {image_path}") # Delete the image with no hands detected os.remove(image_path) # Path to your data folder containing subfolders data_folder = "data" mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles # Iterate through subfolders for folder_name in os.listdir(data_folder): folder_path = os.path.join(data_folder, folder_name) if os.path.isdir(folder_path): print(f"Checking images in folder: {folder_name}") # Iterate through images in the folder for filename in os.listdir(folder_path): if filename.endswith(".jpg") or filename.endswith(".png"): image_path = os.path.join(folder_path, filename) process_and_show(image_path, mp_drawing)
@debarghyakundu908
@debarghyakundu908 3 месяца назад
i wnat to crete senetence ?what to do
@user-nc1bc4hn2d
@user-nc1bc4hn2d Месяц назад
Hello everyone, please tell me, maybe someone knows why when you run the test you get this error: "ValueError: X has 84 features, but RandomForestClassifier is expecting 42 features as input". how can i fix this? Thanks in advance for the answer!
@fruitpnchsmuraiG
@fruitpnchsmuraiG Месяц назад
hey did it work then?
@user-nc1bc4hn2d
@user-nc1bc4hn2d Месяц назад
​@@fruitpnchsmuraiG Yes, the program starts, detects the gesture, but after a minute it shuts down and gives the above error
@mohamedlhachimi2933
@mohamedlhachimi2933 15 дней назад
i think guys to solve this problem we had to tell the collect data script to save just frames where he could detect our hands else we will store bad models that will ends with this getting errors like "inhomogeneous shapes" , i actually try to solved this problem by not moving my hand when collecting data and making my model else you can try this code to check your images that are stored This script will only print the paths of the images that are deleted due to no hands being detected. It won't display any image windows. ##########################################" import os import cv2 import mediapipe as mp def process_and_show(image_path, mp_drawing): mp_hands = mp.solutions.hands hands = mp_hands.Hands() # Read the image image = cv2.imread(image_path) image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) # Detect hands and landmarks results = hands.process(image_rgb) if not results.multi_hand_landmarks: print(f"Deleted image: {image_path}") # Delete the image with no hands detected os.remove(image_path) # Path to your data folder containing subfolders data_folder = "data" mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles # Iterate through subfolders for folder_name in os.listdir(data_folder): folder_path = os.path.join(data_folder, folder_name) if os.path.isdir(folder_path): print(f"Checking images in folder: {folder_name}") # Iterate through images in the folder for filename in os.listdir(folder_path): if filename.endswith(".jpg") or filename.endswith(".png"): image_path = os.path.join(folder_path, filename) process_and_show(image_path, mp_drawing)
@HECTORMAURICIOMORANBOBADILLA
@HECTORMAURICIOMORANBOBADILLA 9 месяцев назад
amazing project, i want to do it but with raspberry pi, some suggestion?
@ComputerVisionEngineer
@ComputerVisionEngineer 9 месяцев назад
Thank you! I haven't tried to do it an edge device, I don't have any suggestions. 🙌
Далее
Thermodynamic Gradient Descent
Просмотров 42
THIS is HARDEST MACHINE LEARNING model I've EVER coded
0:36
A.I. Is a Big Fat Lie - The Dr. Data Show
31:07
Просмотров 37 тыс.
How to use the ChatGPT API with Python!!
0:49
Просмотров 497 тыс.