wyyadd commited on
Commit
75901a0
·
1 Parent(s): 0f1cdf3

feat: update app

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -5,7 +5,11 @@ from model import TARGET_LABELS
5
 
6
 
7
  def get_face_type(img):
8
- pred_binary = get_pred_binary(img)
 
 
 
 
9
  result = "\n".join([f"{label}: {bool(pred)}" for label, pred in zip(TARGET_LABELS, pred_binary)])
10
  face_type = int(''.join(map(str, pred_binary)), 2)
11
  result = f"face_type: {face_type}\n{result}"
 
5
 
6
 
7
  def get_face_type(img):
8
+ try:
9
+ pred_binary = get_pred_binary(img)
10
+ except Exception as e:
11
+ return str(e)
12
+
13
  result = "\n".join([f"{label}: {bool(pred)}" for label, pred in zip(TARGET_LABELS, pred_binary)])
14
  face_type = int(''.join(map(str, pred_binary)), 2)
15
  result = f"face_type: {face_type}\n{result}"