huy00001 commited on
Commit
bbfa2cb
·
verified ·
1 Parent(s): 5a30074

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
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) # bỏ nếu không muốn hiển thị
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,