RICHERGIRL commited on
Commit
326ae0e
·
verified ·
1 Parent(s): d9b1d57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
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):