text_plain_output_1.png
from deepface import DeepFace

import cv2

import matplotlib.pyplot as plt

index = 0
def emotions(image):
    img = cv2.imread(image)
    plt.imshow(img[:, :, ::-1])
    demography = DeepFace.analyze(image, actions=['emotion'], enforce_detection=False, detector_backend='retinaface')
    return demography
emotion = emotions(image='/kaggle/input/newpic/2Q__ (2)_face.png')
dominant_emotion = emotion[index]['dominant_emotion']
print(emotion)
print('Dominant_emotion:', dominant_emotion)