thank you so much, I have one question, how to solve the problem of data imbalance ? because there is one class countian around 500 images and other classes more than 5000 images.
You are most welcome! Thats more simple. Just read image and apply the emotion detection. In video we are doing the same. Video is nothing but set of multiple images/frames. In you context you just have to apply on single image/frame.
hey there it is indeed a wonderful project and the accuracy you have obtained is great btw my question is that instead of loading the videos how can we use camera for real time detection? Thanks again for explaining the project
When you are creating video capture with openCV pass 0 as argument to access your laptops default camera. If you want to access any othe IP based camera then pass full address of that camera. Same program will work fine. It may you get some lag in real time. For that you may need to process least frames per second to avoid it.
@@DataMagicAI An other query is, Basically I know nothing about this and can you please suggest to me what I should read like what are the prerequisites for this project?
This a great video! I have a question though: How can I get the probability of each emotion prediction? Like how sure is the model that the face is happy or sad.
great project would you please tell me waht is percentage of traning and testing of dataset also we want to detect percentage of depression how can we do that
That's great, I don't know where I can get more emotional videos like in the code so there is only one video in your code so I want to find more to try
Sir, can you please help me with how to build my own image dataset. Geotagging, labeling and many concepts has to be looked after. As i am beginner is confused, please help me.
Data science it very broder field...open cv is just one small area of Computer Vision problems. Copy paste is not enough ,I f you want to be data scientist. Data science is all about getting deep dive into data.
Can we perform project in Jupiter notebook to perform in Jupiter notebook we need to upload dataset in Jupiter notebook so huge database how can be uploaded in Jupiter notebook can you suggest techniques to upload.
hi sir, your code work perfectly but there is some issue if i try to run in .ipynb (i copying your code into ipynb file) error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. how do i fix them ? *find on stack overflow that we should delete the opencv-headless file but i don't know where the file is *i use mini conda (conda install opencv)
@@DataMagicAI Boss, please tel me, i have a macbook pro 2.2Ghz processor, 8Go memory, is it risky for my machine to train the model, i m afraid to crush the processor because of high level of hit. Thank you in advance Boss
@@DataMagicAI Hi, output emotion detection window is playing video with slow speed and no sound, could you please tell me how i can detect emotion with normal speed of playing video and with sound !
tensorflow:Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least `steps_per_epoch * epochs` batches (in this case, 14336 batches). You may need to use the repeat() function when building your dataset. Why am I getting this error ??
Hello Sir, I am building my own facial emotion detection model on google colaboratory but it is taking a very long time (1 epoch took an hour) and after about 3 epochs my runtime stops on its own (because it takes around 3-4 hours). Is there a way I can continue execution from the point where the execution stopped becuase I have been trying for 3 days but the model is not getting trained. Otherwise, what do you suggest I do?
You can use directly pertained model too. If you want you can retrain amd create your own model too. It will take 8 hours on CPU and couple of hours on GPU to train it.
Download dataset from kaggle and place under data folder inside of your project repository. All files are using relative paths from your project directory only. Go through ReadMe file from GitHub repository for more information.
There is always more scope to do preprocessing in different ways. You can try with some other preprocessing and see if you are able to achieve better results.
In opencv video capture provide the camera full address. If you are using default laptop camera then just pass 0. If you want to apply on image then use opencv imread to load image n then pass it for processing. Check out computer vision with opencv playlist on our channel where we have videos on how to read image/ video or live cameras.
How can I run it on my computer? It has been more than 10 days that I have been trying and it has caused me a psychological condition. Note that I downloaded the file from kaggle and called it in Python. Please can someone make a video? It is my graduation research.😢
Hello sir I have got a problem when I run train....py file said: 2529 if scipy is None: 2530 raise ImportError( 2531 "Image transformations require SciPy. " "Install SciPy." 2532 ) 2534 # Input sanity checks: 2535 # 1. x must 2D image with one or more channels (i.e., a 3D tensor) 2536 # 2. channels must be either first or last dimension
-> 2529 if scipy is None: 2530 raise ImportError( 2531 "Image transformations require SciPy. " "Install SciPy." 2532 ) 2534 # Input sanity checks: 2535 # 1. x must 2D image with one or more channels (i.e., a 3D tensor) 2536 # 2. channels must be either first or last dimension NameError: name 'scipy' is not defined
At a high level it tries to find the different lines curves and dots in the image. Neural Network looks at image in term of the each pixel value and what it’s intensity.
TypeError: Could not locate class 'Sequential'. Make sure custom classes are decorated with `@keras.saving.register_keras_serializable()`. PLEASE HELP ME HOW TO RESOLVE THIS.
Sir I beg up please help me When I downloaded and paseted the haarcascade frontal_face. xml file in Haarcascade directory, it is showing file size greater than 2.56MB. What shall i do sir. I really need your help. Do I need to the create the xml file and write code snippets or do I need to download and paste it
@@DataMagicAI AttributeError: module 'tensorflow.keras.preprocessing' has no attribute 'image_dataset_from_directory' But I constantly get this error, I tried to run this code on VS code, pycharms, everywhere
Download dataset from kaggle and place under data folder inside of your project repository. All files are using relative paths from your project directory only. Go through ReadMe file from GitHub repository for more information.
If you keep dataset inside of your PyCharm project directory then you will be able to see dataset in PyCharm. There is nothing like adding dataset to PyCharm. You can put your dataset in any directory and pass that directory to your python code in PyCharm to load and train dataset.
Can u do me favour Pls provide me the model , just put the model on a drive plszzzz and provide me the link ,pls i need it ,,,pls provide it within this week
- diagnosis dipression - check employee stress level - student reactions on classes - live gaming.experience - automobile safety features - patient monitoring system These are few but there could be lot of areas where we can utilise emotion detection to solve the real life problems...
Thanks! One of the best videos to understand how CNN actually works!
Thank you!
@@DataMagicAI Great video!!!, can you make a video like this with more updated tools?
It is super-worth to watch every second of the video, Thank You Sir🤗
Your welcome!
@@DataMagicAI which source is used for compilation of code
Your lecture is amazing l am learning soo much form this
Thank you!
Perfect Video! Thanks for showing me, how to create such a nice Emotion-Detecion. :D
You're very welcome! Code in the description box!
thank you so much, I have one question, how to solve the problem of data imbalance ? because there is one class countian around 500 images and other classes more than 5000 images.
By over sampling.
Nice Video. Can you share the face expression videos with us
what values did you get in accuracy and val_accuracy?
Thank you so much sir.
this video is too good.
I just wanted to know that how can we use it on photos?
You are most welcome! Thats more simple. Just read image and apply the emotion detection.
In video we are doing the same. Video is nothing but set of multiple images/frames. In you context you just have to apply on single image/frame.
Really thank you so much for your reply… but how can I do that? Because when I tried to do that, it was giving me error.
amazing! learnt a lot!
Glad it was helpful!
hey there it is indeed a wonderful project and the accuracy you have obtained is great btw my question is that instead of loading the videos how can we use camera for real time detection? Thanks again for explaining the project
When you are creating video capture with openCV pass 0 as argument to access your laptops default camera.
If you want to access any othe IP based camera then pass full address of that camera.
Same program will work fine.
It may you get some lag in real time. For that you may need to process least frames per second to avoid it.
@@DataMagicAI I see thank you very much for a quick response
@@DataMagicAI An other query is,
Basically I know nothing about this and can you please suggest to me what I should read like what are the prerequisites for this project?
Kindly make video with CK+ dataset
This a great video! I have a question though:
How can I get the probability of each emotion prediction? Like how sure is the model that the face is happy or sad.
With Relu function?
iT FUKINNN WORKS!!!
great project would you please tell me waht is percentage of traning and testing of dataset
also we want to detect percentage of depression how can we do that
80-20
unable to get your github link, if anyone get plz provide or pinned proper link of entire code.
can we change the expression to sign language in the code ?
Do you have any videos related to deepfakes and synthetic data
Thank you sir
Welcome
That's great, I don't know where I can get more emotional videos like in the code so there is only one video in your code so I want to find more to try
Check on pexel.com
@@DataMagicAI What do I have to record to get a video like that?
@@DataMagicAI sir isme hum apna front camera ke sath emotion kaise detect ker sakte hai te btaa dijiye
can we use this model for speech emotion recognition?
i wish that one day i would be able to build something like this
You can build it. Its not rocket science. You can join our ML course and learn skills required to build these kind of system.
That's good, thank you!
Glad you like it!
Sir, can you please help me with how to build my own image dataset. Geotagging, labeling and many concepts has to be looked after. As i am beginner is confused, please help me.
Hello! Are you using some signal processing or Gabor Filters?
Nope!
@@DataMagicAI do you have any code using a Gabor Filter? I need it for a school project, and I can't find any resoursces...
As a data scientist, should the person by heart the entire open cv code or just copy paste??
Data science it very broder field...open cv is just one small area of Computer Vision problems. Copy paste is not enough ,I f you want to be data scientist. Data science is all about getting deep dive into data.
thanks alot
Most welcome
Can we perform project in Jupiter notebook to perform in Jupiter notebook we need to upload dataset in Jupiter notebook so huge database how can be uploaded in Jupiter notebook can you suggest techniques to upload.
You have to keep dataset on your system. Just provide path of data while loading in Jupyter notebook.
hi sir, your code work perfectly
but there is some issue if i try to run in .ipynb (i copying your code into ipynb file)
error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support.
how do i fix them ?
*find on stack overflow that we should delete the opencv-headless file but i don't know where the file is
*i use mini conda (conda install opencv)
From where you found the code
PLEASE HELP WITH THIS ERROR - AttributeError: 'str' object has no attribute 'decode'
@@sid1784 you have to read it using tf.io.read_file(image_path)
On the second Conv2D why is it a 64 layer size?
if we train the model using gray scale image can we predict rgb images also?
Yes, you need to preprocess your image to gray scale before feeding it to model.
Sir can you help me with this error I get when I prompt to train the system, OSError: [WinError 126] The specified module could not be found
Hey can you share sample video you used for testing
Sorry, I dont have it now. You can search on pexel.com
thank you so much
Your welcome!
How to train the model. I have i5, 8gb ram. How much time will it take on muy system??
Code is provided in the description box. Can’t tell exactly but It will take at least 3-4 hours on i5.
can we predict depression using this project also recognize face and send motivational message to user
you cant predict depression just by AI. Yet.
from keras.models import Sequential
ModuleNotFoundError: No module named 'keras'
how to resolve this problem sir ?
Keras is not installed. Install it
What is the accuracy of this model
Amazing work. Please how can i get the scripts ?
Do you mean code?
@@DataMagicAI Yes Boss, possible to have it please?
@@DataMagicAI Boss, please tel me, i have a macbook pro 2.2Ghz processor, 8Go memory, is it risky for my machine to train the model, i m afraid to crush the processor because of high level of hit.
Thank you in advance Boss
sir can i ask you
how to use this model on mobile apps and i can use camera on mobile to detect emotion
You might need to developer some light version of this model to work on edge devices
Please Commercialize this tool, I want this solution, how to buy it
You can contact us on datamagic2020@gmail.com
@@DataMagicAI Hi, output emotion detection window is playing video with slow speed and no sound, could you please tell me how i can detect emotion with normal speed of playing video and with sound !
tensorflow:Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least `steps_per_epoch * epochs` batches (in this case, 14336 batches). You may need to use the repeat() function when building your dataset.
Why am I getting this error ??
you probably don't have enough pictures in your dataset to complete the training
Can you tell me what he wrote at the end of line 43 ..... plzzzzzz.... after cv2.LINE_A
Can you give me the .json and .h5 files? Or can I have the sourcecode please? Thank you
Where can i get the dataset?
Hello Sir, I am building my own facial emotion detection model on google colaboratory but it is taking a very long time (1 epoch took an hour) and after about 3 epochs my runtime stops on its own (because it takes around 3-4 hours). Is there a way I can continue execution from the point where the execution stopped becuase I have been trying for 3 days but the model is not getting trained. Otherwise, what do you suggest I do?
use google tpu instead of your computer cpu
how can i use this trained dataset in for a mobile app?
SAME QUESTION ... Did you find a way ?????? if yeah, then plzzz tell me
you can deploy this model as service . and access this service in your mobile app.
@@DataMagicAI ok thanks alot ✨👍
Is it possible to fuse with audio recognition model and get final multimodal emotion recognition?
Yes
Kindly post how to annotate the images. Tell about tools
I have shown it in this episode. Please check the same.
Im not able to understand tr train step after we download all the libraries the what we have to do to get that 2 files .json and the another one
You need to train model then save the trained model structure in Json file and mode weights in h5 file. So you can use this trained model later.
Hi when i run the project i faced this error (No module named 'tensorflow.compat')??!
Seems library conflict issues. Search on internet. I can’t help without knowing the environment details.
i am getting the same error ,how to resolve it
Hello are we supposed to train the data even tho the downloaded code already has h5 and json file?
You can use directly pertained model too. If you want you can retrain amd create your own model too. It will take 8 hours on CPU and couple of hours on GPU to train it.
Sir all the folders and director are placed under the emotion detection folder..??
Download dataset from kaggle and place under data folder inside of your project repository. All files are using relative paths from your project directory only.
Go through ReadMe file from GitHub repository for more information.
can anyone can list what are the tools used and for what purpose it is used?
@@srisangeeth4131 did this code work for you?
hi sir is the preprocessing on the images i mean the operation is enough ????
There is always more scope to do preprocessing in different ways. You can try with some other preprocessing and see if you are able to achieve better results.
when i install keras their is a problem, what is that????????????
Sir how can I run the camera to detect the live photo and how to run the image to get output
In opencv video capture provide the camera full address. If you are using default laptop camera then just pass 0.
If you want to apply on image then use opencv imread to load image n then pass it for processing.
Check out computer vision with opencv playlist on our channel where we have videos on how to read image/ video or live cameras.
@@DataMagicAI @Data Magic (by Sunny Kusawa) sir I'm a beginner.... Can u plzzzz tell me how you add Data folder (train and test) ???
Can you send me those samples video you used
How can I run it on my computer? It has been more than 10 days that I have been trying and it has caused me a psychological condition. Note that I downloaded the file from kaggle and called it in Python. Please can someone make a video? It is my graduation research.😢
bro i need that link from where u downloaded
Hello sir I have got a problem when I run train....py file said:
2529 if scipy is None:
2530 raise ImportError(
2531 "Image transformations require SciPy. " "Install SciPy."
2532 )
2534 # Input sanity checks:
2535 # 1. x must 2D image with one or more channels (i.e., a 3D tensor)
2536 # 2. channels must be either first or last dimension
-> 2529 if scipy is None:
2530 raise ImportError(
2531 "Image transformations require SciPy. " "Install SciPy."
2532 )
2534 # Input sanity checks:
2535 # 1. x must 2D image with one or more channels (i.e., a 3D tensor)
2536 # 2. channels must be either first or last dimension
NameError: name 'scipy' is not defined
Is seems younhave not installed all packages correctly. This error show scipynpackage is not installed please install it.
hey, exactly what type of features are being extracted
At a high level it tries to find the different lines curves and dots in the image. Neural
Network looks at image in term of the each pixel value and what it’s intensity.
And where is the data folder in the zip file.
Hello!! Do I need to download all the requirements??
Yes
What percentage of the dataset is used for training and testing?
80
Code link is not accessible
Sir another kind help. I have copied and pasted . h5 file but I am not able to view it. What shall I do sir
What do you want to view?
@@DataMagicAI sir, a kind help for me too. I cannot copy or carry or import this emotin_model.h5 file to pycharm. how can I handle it.
What is the accuracy did you get?
92%
@@DataMagicAI sir may I know which dataset is better for emotion recognition whether it is ck+ dataset or fer 2013 dataset
@Ratnadeep Mazumder how to fix it
I need this expression changing video to check my model
Plz check on pexel.com
how to get deep and machine learning code for emotion detection, would u help me
Go to description box. Code link is provided
Bro I have downloaded the kaggle database. How to add it in my pycharm ide. Please help me bro
You just add the full path of your data folder in the code which you written in Pycharm. No special process to add data in Pycharm.
TypeError: Could not locate class 'Sequential'. Make sure custom classes are decorated with `@keras.saving.register_keras_serializable()`. PLEASE HELP ME HOW TO RESOLVE THIS.
Sir I beg up please help me
When I downloaded and paseted the haarcascade frontal_face. xml file in Haarcascade directory, it is showing file size greater than 2.56MB. What shall i do sir. I really need your help. Do I need to the create the xml file and write code snippets or do I need to download and paste it
Please help me sir. I am in a very critical situation
You need to download harcascade xml file
sir there no code in that link pls send code link
Do I need a GPU for this code? Because I am getting CUDA GPU errors
Its warning ignore...you can run it without GPU
@@DataMagicAI AttributeError: module 'tensorflow.keras.preprocessing' has no attribute 'image_dataset_from_directory' But I constantly get this error, I tried to run this code on VS code, pycharms, everywhere
how did make file under file like in data in pycharm please reply
You mean folder under folder?
Wt are the requirements for system to install pycharm?
Please check on below link all the requirements.
www.jetbrains.com/help/pycharm/installation-guide.html#requirements
Sir which libraries are import for this code?
Plz check in the code all libraries.
How to apply code on ck+ dataset??
hello where did you found the code plz ? i didint found it on the link in description
Can I make it for image only ?
Yes
@@DataMagicAI i have having problem downloading tenserflow and grpcio will this be because of paython 3.9 ??
Accuracy is so low like 17% how to fix this?
The cv2.resize() don’t work to me
What's the error. Make sure you are reading the image/video properly and not having empty feed.
Sir I can't able to find the code please help did any one found the code
Its in description box.
@@DataMagicAI Sir, the link cannot be reached
My evaluate file is not working ....
What error you are getting?
Can you tell me directory of the folder
Download dataset from kaggle and place under data folder inside of your project repository. All files are using relative paths from your project directory only.
Go through ReadMe file from GitHub repository for more information.
Is it possible to deploy this
Yes!
@@DataMagicAI I am trying to deploy this but I get errors
Sir how to check accuracy?
share on GitHub, please check.
i need source website contain video demo
Pexel
@@DataMagicAI thank you so much
Flow chart of this system?
Not readily available. You can drop an email at datamagic2020@gmail.com
How to add downloaded datasets to pycharm
If you keep dataset inside of your PyCharm project directory then you will be able to see dataset in PyCharm.
There is nothing like adding dataset to PyCharm. You can put your dataset in any directory and pass that directory to your python code in PyCharm to load and train dataset.
@@DataMagicAI Sir Kindly Upload a Practical video, how to do this. I tried but couldn't find any results.
Thanks!
Can u do me favour
Pls provide me the model , just put the model on a drive plszzzz and provide me the link ,pls i need it ,,,pls provide it within this week
Download it from here: github.com/datamagic2020/Emotion_detection_with_CNN/tree/main/model
I have copied the code but I'm getting errors
Follow the steps properly, others are able to run it.
flow form directory showing error
Send the error
Can u give the flow chart for this sir
I don't have it ready...
@@DataMagicAI how to get the graphical represent can u please tell me sir.
make use of matplotlib library in python to plot the accuracy and loss graphs
How to train a data set CNN
If you need full support. Drop email at datamagic2020@gmail.com
hi bro please tell me the uses of this emotion detection
- diagnosis dipression
- check employee stress level
- student reactions on classes
- live gaming.experience
- automobile safety features
- patient monitoring system
These are few but there could be lot of areas where we can utilise emotion detection to solve the real life problems...
Mine showing error adam is not defined
Make sure you have addded the import statement for Adam.
from keras.optimizers import Adam
@@DataMagicAI tq,s for replying but how to train our data model...like u said 4 hours......like how to do that just by simply running that train code
it only shows 17% on evaulateemotiodetector
Same did you know why?
where is github link?
Code link in description box
It is running an infinite loop
Press q
can you please share the github link
Code link in the description box
@@DataMagicAI sample video not available in code
where is code
Check description box