Emotion Detection -Python Project using Machine Learning & OpenCV - with code (Face Expressions)
ฝัง
- เผยแพร่เมื่อ 6 ก.พ. 2025
- Here we go over a Python Project using OpenCV and simple Machine Learning
Google Colab Link : colab.research...
Support me on Patreon
/ misbahmohammed
💻 General Tech
Dell Tower - amzn.to/3gHXAVV
Monitor -amzn.to/2R0Mqk7
Keyboard - amzn.to/3u2hPRS
Mouse - amzn.to/3gMc72G
Portable SSD - amzn.to/3voO8us
Headset - amzn.to/3gI6K4t
Airpods - amzn.to/3gK96Qu
📸 Camera Gear
Main Camera - amzn.to/3uae8cI
Main Lens - amzn.to/3sXim6b
Tripod - amzn.to/3vtsRA1
Jobi Tripod - amzn.to/3eEo6wu
Memory Card - amzn.to/3vt2quj
🎥Video Accessories
Mic - amzn.to/3uaeIHq
Mic Arm - amzn.to/3tSkSMp
Writing Pad - amzn.to/3nuxG9w
Green Screen - amzn.to/3gQjnui
LED lights - amzn.to/3nrQbex
👨💻Books I like on Personal Growth
Compound Effect - amzn.to/3vm815s
Rework - amzn.to/32TE3K4
Four Hour Work Week - amzn.to/32SrOx5
Tools of Titans - amzn.to/3eEtfVx
The Last Lecture - amzn.to/3dWia31
Sam Walton - amzn.to/3b1nOPB
Originals - amzn.to/3eyfUOt
Blink - amzn.to/3sU0KIp
The Tipping Point - amzn.to/3vuBKJH
Rich Dad Poor Dad - amzn.to/3eCPRpq
👨💻Books I like on Investing
One up on Wall Street - amzn.to/3aFWohF
Intelligent Investor - amzn.to/3xtMD08
Common Sense Investing - amzn.to/3vuCbDP
DISCLOSURE: Some of the links on this page are affiliate links, meaning, at no additional cost to you, I may earn a commission if you click through and make a purchase. Affiliate commissions help fund videos like this one.
Thank you, sir.. It's very helpful and just impressive!! Feed your knowledge a lot to us
Thank you... It is very helpful for me to get a good glimpse of how it works
can i used this for ml project in college? how to i show them code and run this? do i have to show them as you showed in this video?
OpenCV(4.1.2) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
This error occured please help
In the step of creating directories:
%cd facial_expressions/
%mkdir -p data_set/{anger,happy,neutral,sad,surprise}
While running it on VS CODE or juypter notebook , I am getting an error saying "The syntax of the command is incorrect."
How do I resolve this...plz help
you should get in contact with the JALI Devs and see if this can be added to the AI
Can you Please help me? The picture you have uploaded the program can only detect those two. It doesn’t detect the pictures from outside.
Really very helpful, cheers to you. 🙂With this u got a subscriber 😁
Glad to know it was of help ... Take care
have u used SVM for classification
If this could be used in games to detect random NPC's emotion used with another NPC AI to react to thoes emotions and choose the best behavior the outcome would be crazy and unpredicted
Thanks sir for your informative video. Can you please put the demonstration on video facial expression detection.
I'll probably have to make another video on that. Will try to look into it soon. However, some of my more recent projects here on the channel are using video processing. Hope they give you an idea 🙂
@@19daredevill Thanks sir will go through it
How can we merge this into a Mobile app to detect in real time?
Which algorithm you have used sir?
Can u send that.!
Sir can you tell what need to be taken x axis & y axis, if we plot a graph for this project
recognizer.train(faces, np.array(ids))
getting error in this line
Sir how to do an accuracy graph for this project?! Can u please help with this
project is this using support vector machine (svm), sir ?
Hello Misbah, thanks for this nice job, I have a question please: how can I run this project on Jupyter notebook independently? there is no Clone Repository as you know, anyway I've downloaded the whole zip file "facial_expressions-master" but how can I run it on Jupyter?
thank you in advance.
Hi, you can always clone the repository in your local computer and then run the Jupyter notebook in that folder. Hope it helps
its only showing surprice accurency level 38
I've triezd to run this code on different images but its not accurate at all :/
What were the issues coming up. I'll try to address them in another video.
@@19daredevill for anger its showing surprise why is it so.....
@@isha_dam have u solved this issue
@@harshahuja176 no but I switched to real time facial expression detection project..which I completed successfully
@@isha_dam can you help me by sending source code of that😅
error: OpenCV(4.1.2) /io/opencv_contrib/modules/face/src/facerec.cpp:61: error: (-2:Unspecified error) File can't be opened for reading! in function 'read'
for line 6 in recognition block, I ma getting this error. I have written the code exactly as directed . please suggest how to overcome this problem
please make a video, in witch u download a code and mange it and run it on others cam and give another pics/ video on runtime
it shows surprise for Dwayne. Any help please!
Hi sir.
I need a code for emotions recognition based on music player
Hi can you get code
I am facing this error:
recognizer.train(faces, np.array(ids))
cv2.error: OpenCV(4.5.1)
help me to resolve it
The user can speak for One minutes themselves while there fase expression are being recorded kindly help this project last start kary??
can u plz tell me which algorithm and method u have used
Thank you for the question. It's using Haar-Cascades for face detection and LBPH for face recognition, which is dependent on texture detection. Wikipedia Link on this : en.wikipedia.org/wiki/Local_binary_patterns Hope it helps
Check this channel out and if it's useful to you, consider subscribing 🙂
unable to upload other images .plz help
Very nice explanation sir
I'm glad it helped you 🙂... take care
Sir I beg up please help me.Its working with happy file only for me.Not working with others.I am in a very critical situation . Please help me sir.What shall i do sir
me neither in my case surprise only works
Thanks for sharing
Salam. It was excellent.
I am trying to do a hybrid model such as CNN with LSTM/GAN/DBN/YOLO for real-time facial emotion recognition.is it possible?
so, did you do it???
That was Informative
Thank you
hey can i have ur mail id. write now i m running ur code but it is not able to detect my face expression
Pls use this email misbahlabs@gmail.com
When I enable all the expressions ,all the images shows 'surprise' even Elon Musk and dwayne.can you please solve this.
same here.Did you get the solution
@@omprakashreddykamireddy6088 No bro, if you get please inform
it says surprise to all faces, did according to what you dictated, where did it go wrong?
It's mostly because of 1-2 reasons, the training dataset should be properly labeled prior to training. The other common problem is the final array that you use for comparing object, should have the correct order of the "emotions". Hope it helps
@@19daredevill Hi, I checked. I have the same problem, it shows 'surprise' for all the images and I double/triple times checked the points you said. Still doesn't work! Please help!
I have another video on this made , see if this helps
th-cam.com/video/heKa-f4rkvg/w-d-xo.html
please share a video specifically for web cam
how do i download the folder after all changes done in collab? so that i can finally run in pycharm
export as .py file
Sir if I upload my photo and run it is showing some error sir what can I do sir
Hi, what is the error you are getting?
Can you plz send me code of this ??
bro github link ?
i m not able to get correct result for my face
Make sure the image is also of good quality and the training was done correctly.
sir which version of openCV should we use?
your Q save me Thanks
it detects surprise for all the images,its not working
It happens if we missed something in the steps. But I made another video on this to help
th-cam.com/video/heKa-f4rkvg/w-d-xo.html
This is the link
@@19daredevill ok i will check it
but thanks for making such videos
good initiative
keep going🤞
thanks i need itpl support
have a nice day
algorithm might be saying surprise to all faces what could be the reason?
The most common issue is at the training stage. If the files are not properly provided or at the detection stage if mistakenly change the detection array, it can cause problems. Hope it helps you
@@19daredevill Thank you
I made another video on this. See if it helps you th-cam.com/video/heKa-f4rkvg/w-d-xo.html
@@19daredevill Thanks Im looking
Sir i would i like to have your help ....regarding my project by using this.....can you put down your mail id so i can contact you?
open.cv emotion detection is easy
which dataset is used here
In the beginning of the video I showed the dataset, it's on GitHub. Also if you open the GitHub Link from the colab, you can see where I forked it from
@@19daredevill ok thank you very much
Hlo sir
Hello are you a freelance coder? I have a project I want to discuss. Could I email you?