SuriRaja commited on
Commit
71a8976
·
verified ·
1 Parent(s): e674980

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -11,15 +11,13 @@ mp_face_mesh = mp.solutions.face_mesh
11
  face_mesh = mp_face_mesh.FaceMesh(static_image_mode=True, max_num_faces=1, refine_landmarks=True, min_detection_confidence=0.5)
12
 
13
  def extract_features(image, landmarks):
14
- mean_intensity = np.mean(image)
15
  red_channel = image[:, :, 2]
16
  green_channel = image[:, :, 1]
17
  blue_channel = image[:, :, 0]
18
- total_pixels = image.shape[0] * image.shape[1]
19
 
20
- red_percent = 100 * np.sum(red_channel > green_channel) / total_pixels
21
- green_percent = 100 * np.sum(green_channel > red_channel) / total_pixels
22
- blue_percent = 100 * np.sum(blue_channel > red_channel) / total_pixels
23
 
24
  return [red_percent, green_percent, blue_percent]
25
 
 
11
  face_mesh = mp_face_mesh.FaceMesh(static_image_mode=True, max_num_faces=1, refine_landmarks=True, min_detection_confidence=0.5)
12
 
13
  def extract_features(image, landmarks):
 
14
  red_channel = image[:, :, 2]
15
  green_channel = image[:, :, 1]
16
  blue_channel = image[:, :, 0]
 
17
 
18
+ red_percent = 100 * np.mean(red_channel) / 255
19
+ green_percent = 100 * np.mean(green_channel) / 255
20
+ blue_percent = 100 * np.mean(blue_channel) / 255
21
 
22
  return [red_percent, green_percent, blue_percent]
23