NOBODY204 commited on
Commit
059fe78
·
verified ·
1 Parent(s): c7e7937

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -114,7 +114,7 @@ def detect_skin_smoothing(img):
114
  if skin_ratio < 0.02:
115
  return -1.0, skin_ratio, skin_vis
116
 
117
- gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY).astype(np.float32)
118
  lap = np.abs(cv2.Laplacian(gray, cv2.CV_64F))
119
  skin_texture = lap[skin_mask == 1]
120
 
@@ -285,4 +285,4 @@ with gr.Blocks() as demo:
285
 
286
  run_btn.click(process, inputs=in_img, outputs=[out_plot, out_text])
287
 
288
- demo.launch(share=True, theme=gr.themes.Soft())
 
114
  if skin_ratio < 0.02:
115
  return -1.0, skin_ratio, skin_vis
116
 
117
+ gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) # uint8 — CV_64F exige uint8 en entrée
118
  lap = np.abs(cv2.Laplacian(gray, cv2.CV_64F))
119
  skin_texture = lap[skin_mask == 1]
120
 
 
285
 
286
  run_btn.click(process, inputs=in_img, outputs=[out_plot, out_text])
287
 
288
+ demo.launch(share=True, theme=gr.themes.Soft())