jahin07 / emotion-recognition Goto Github PK
View Code? Open in Web Editor NEWA classification model in Machine Learning capable of recognizing human facial emotions
A classification model in Machine Learning capable of recognizing human facial emotions
I'm a noob! how do you get those datasets? I got the email but not sure which to download?
error: Traceback (most recent call last):
File "C:\Python27\ck_org.py", line 25, in
emotion = int(float(file.readline())) #emotions are encoded as a float, readline as float, then convert to integer.
ValueError: could not convert string to float: Þ4ðàõ5
Error Line : emotion = int(float(file.readline())) #emotions are encoded as a float, readline as float, then convert to integer.
`
import glob as gb
from shutil import copyfile
emotions_list = ["neutral", "anger", "contempt", "disgust", "fear", "happy", "sadness","surprise"]
emotions_folders = gb.glob("emotions//*") #Returns a list of all folders with participant numbers
def imageWithEmotionEtraction():
for x in emotions_folders:
participant = "%s" %x[-4:] #store current participant number
for sessions in gb.glob("%s//" %x):
for files in gb.glob("%s//" %sessions):
current_session = files[20:-30]
file = open(files, 'r')
emotion = int(float(file.readline()))
#get path for last image in sequence, which contains the emotion
sourcefile_emotion = gb.glob("images/%s/%s/*" %(participant, current_session))[-1]
#do same for neutral image
sourcefile_neutral = gb.glob("images/%s/%s/*" %(participant, current_session))[0]
#Generate path to put neutral image
dest_neut = "selected_set/neutral/%s/" %sourcefile_neutral[25:]
#Do same for emotion containing image
dest_emot = "selected_set/%s/%s/" %(emotions_list[emotion], sourcefile_emotion[25:])
copyfile(sourcefile_neutral, dest_neut) #Copy file
copyfile(sourcefile_emotion, dest_emot) #Copy file
if name == 'main':
imageWithEmotionEtraction() `
and the error im getting is shown below plz help me
Traceback (most recent call last):
File "img_seq1.py", line 36, in
imageWithEmotionEtraction()
File "img_seq1.py", line 31, in imageWithEmotionEtraction
copyfile(sourcefile_emotion, dest_emot) #Copy file
File "/usr/lib/python3.6/shutil.py", line 120, in copyfile
with open(src, 'rb') as fsrc:
IsADirectoryError: [Errno 21] Is a directory: 'images/S156/002'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.