Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,12 @@ import cv2
|
|
| 3 |
import numpy as np
|
| 4 |
import mediapipe as mp
|
| 5 |
from sklearn.cluster import KMeans
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# ADD this function near the top
|
| 8 |
def recommend_mask_style(face_shape, skin_tone):
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
import mediapipe as mp
|
| 5 |
from sklearn.cluster import KMeans
|
| 6 |
+
import os
|
| 7 |
+
|
| 8 |
+
# Train the model once at startup
|
| 9 |
+
if not os.path.exists("mask_model.pkl"):
|
| 10 |
+
exec(open("train_model.py").read())
|
| 11 |
+
|
| 12 |
|
| 13 |
# ADD this function near the top
|
| 14 |
def recommend_mask_style(face_shape, skin_tone):
|