Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,14 +15,13 @@ def analyze_image(image):
|
|
| 15 |
"Tuổi ước tính": info["age"],
|
| 16 |
"Giới tính": "Nam" if info["dominant_gender"] == "Man" else "Nữ",
|
| 17 |
"Cảm xúc chính": info["dominant_emotion"],
|
| 18 |
-
"Chủng tộc": info["dominant_race"]
|
| 19 |
-
"Độ tin cậy": round(info["face_confidence"], 2)
|
| 20 |
}
|
| 21 |
return json.dumps(output, ensure_ascii=False, indent=2)
|
| 22 |
except Exception as e:
|
| 23 |
return f"Lỗi: {str(e)}"
|
| 24 |
|
| 25 |
-
|
| 26 |
# Tạo giao diện Gradio
|
| 27 |
demo = gr.Interface(
|
| 28 |
fn=analyze_image,
|
|
|
|
| 15 |
"Tuổi ước tính": info["age"],
|
| 16 |
"Giới tính": "Nam" if info["dominant_gender"] == "Man" else "Nữ",
|
| 17 |
"Cảm xúc chính": info["dominant_emotion"],
|
| 18 |
+
"Chủng tộc": info["dominant_race"],
|
| 19 |
+
"Độ tin cậy": round(info["face_confidence"], 2)
|
| 20 |
}
|
| 21 |
return json.dumps(output, ensure_ascii=False, indent=2)
|
| 22 |
except Exception as e:
|
| 23 |
return f"Lỗi: {str(e)}"
|
| 24 |
|
|
|
|
| 25 |
# Tạo giao diện Gradio
|
| 26 |
demo = gr.Interface(
|
| 27 |
fn=analyze_image,
|