Update app.py
Browse files
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.
|
| 21 |
-
green_percent = 100 * np.
|
| 22 |
-
blue_percent = 100 * np.
|
| 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 |
|