feat: update app
Browse files
app.py
CHANGED
|
@@ -5,7 +5,11 @@ from model import TARGET_LABELS
|
|
| 5 |
|
| 6 |
|
| 7 |
def get_face_type(img):
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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}"
|