Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi Team.
I am following below link to achieve emotion analysis - https://www.phdata.io/dataiku-deep-learning-tutorial-emotion-classification-in-videos/
I performed 10 epochs with 10 steps in every epochs while using 'Retraining image classification model'
The processor is iterating on each row but your predictor does not output probas for every emotion on every line.
I added a if statement to check if the emotion is in the prediction
import json
def process(row):
max_val = 0
max_label = None
emotions = ['calm', 'sad', 'surprised', 'neutral', 'fearful', 'angry', 'happy', 'disgust']
for e in emotions:
if e in json.loads(row['prediction']):
p = float(json.loads(row['prediction'])[e])
if p > max_val:
max_val = p
max_label = e
row['max_prediction'] = max_val
row['max_label'] = max_label
row['label'] = row['images'].split('_')[1]
row['correct'] = 1 if row['label'] == row['max_label'] else 0
row['video_path'] = '/{}.mp4'.format(row['images'].split('_')[0])
return row
Alternatively, you can adjust the scoring recipe to provide all 8 classification labels as outputs.
Thanks a lot Arnaud for your extended help. I completed the entire pipeline