From 56eede6777e7d6a2ffab19cd0e11e353e2b97df2 Mon Sep 17 00:00:00 2001 From: Mateusz Tylka Date: Sun, 29 Jan 2023 21:14:30 +0100 Subject: [PATCH] cr fixes --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 72009c1..242faab 100644 --- a/main.py +++ b/main.py @@ -8,6 +8,7 @@ import numpy as np from source.cartoonize import Cartoonizer + def load_source(filename: str) -> np.ndarray: return cv2.imread(filename)[...,::-1] @@ -17,7 +18,7 @@ def find_and_crop_face(data: np.ndarray) -> np.ndarray: face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_default.xml') face = face_cascade.detectMultiScale(data_gray, 1.3, 4) face = max(face, key=len) - (x, y, w, h) = face + x, y, w, h = face face = data[y:y + h, x:x + w] return face