Spaces:
Sleeping
Sleeping
Create app.py
Browse files123456789101112131415161718192021222324252627282930from deepface import DeepFaceimport gradio as gr
def face_score(img): analysis = DeepFace.analyze( img, actions=['age', 'emotion'], enforce_detection=False )
emotion = max(analysis[0]['emotion'], key=analysis[0]['emotion'].get) age = analysis[0]['age']
attractiveness = min(9.5, 6.5 + (analysis[0]['emotion'].get('happy', 0) / 20)) confidence = min(9.5, 6 + (analysis[0]['emotion'].get('neutral', 0) / 15)) professional = min(9.5, 5 + (age / 10))
return { "Attractiveness Score": round(attractiveness, 1), "Confidence Score": round(confidence, 1), "Professional Look": round(professional, 1), "Detected Emotion": emotion }
gr.Interface( fn=face_score, inputs=gr.Image(type="numpy"), outputs="json", title="FaceScore – AI First Impression").launch()app.pyAdded+30