anujakkulkarni commited on
Commit
4aaa514
Β·
verified Β·
1 Parent(s): ab3d75b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -10,13 +10,14 @@ from concurrent.futures import ThreadPoolExecutor, as_completed, TimeoutError
10
 
11
  # -------------------- CONFIG --------------------
12
  model_paths = {
13
- "pores": "pores.pt",
14
- "pig1": "pig1.pt", # βœ… added pigmentation model
15
  "combine": "combine.pt", # βœ… combine model
16
  "wrinkle": "wrinkle.pt",
17
  }
18
  default_conf_threshold = 0.05
19
- special_conf_threshold = 0.08 # βœ… used for combine & pig1
 
20
  imgsz = 1024
21
 
22
  # -------------------- INIT --------------------
@@ -79,8 +80,10 @@ def detect_skin_type_from_image(img):
79
 
80
  # -------------------- HELPERS --------------------
81
  def run_model(model_name, model, img, face_polygon, face_area):
82
- # βœ… set special conf threshold for combine.pt & pig1.pt
83
- if model_name in ["combine", "pig1"]:
 
 
84
  conf = special_conf_threshold
85
  else:
86
  conf = default_conf_threshold
 
10
 
11
  # -------------------- CONFIG --------------------
12
  model_paths = {
13
+ "pores2": "pores2.pt",
14
+ "pig1": "pig1.pt", # βœ… pigmentation model
15
  "combine": "combine.pt", # βœ… combine model
16
  "wrinkle": "wrinkle.pt",
17
  }
18
  default_conf_threshold = 0.05
19
+ special_conf_threshold = 0.08 # βœ… for combine & pig1
20
+ pores2_conf_threshold = 0.12 # βœ… special for pores2
21
  imgsz = 1024
22
 
23
  # -------------------- INIT --------------------
 
80
 
81
  # -------------------- HELPERS --------------------
82
  def run_model(model_name, model, img, face_polygon, face_area):
83
+ # βœ… confidence logic
84
+ if model_name == "pores2":
85
+ conf = pores2_conf_threshold
86
+ elif model_name in ["combine", "pig1"]:
87
  conf = special_conf_threshold
88
  else:
89
  conf = default_conf_threshold