How to add emotion recognition to your AI/Chatbot
How to add emotion recognition to your AI/Chatbot
So, Ever wonder how would it feel if your AI could understand your emotions to a physical extent. Honestly No 🤣, But can't hurt to try right. So, I did try and succeeded to some extent.
If you don’t already have a AI/Chatbot Setup read my article on how to make one:
Firstly lets get started with the imports:-medium.com
Let's see how it’s done.
Like all python codes lets start with the imports first:
As you can see we will be using cv2 for image processing and deepface library for facial tracking.
Now lets get the harrcascade xml file and processing it for our work:
Lets check for webcam inputs and use it:
Let’s make our video input greyscale cuz it makes it very easy to process the video file:
Now lets track the face and make rectangle on the face and use deepface to detect the dominant emotion:
Lets now just print the output and stop the loop accordingly:
The code is finished as easy as that!!
Lets impliment it in my AI called ‘DEW’:
As you can see just with two lines of code in line number 17 and 112 our AI has emotion recognition now.
Lets see some results 😁
Thanks for reading 😁
Have fun coding :) , Follow for more fun AI stuff 😁
Check out my Github for more stuff:
You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or…github.com
Follow me on twitter for my day to day AIML research updates:
Thanks for reading :) , See ya next time.