Update handler.py
Browse files- handler.py +1 -2
handler.py
CHANGED
|
@@ -193,7 +193,6 @@ class EndpointHandler:
|
|
| 193 |
|
| 194 |
face_info = max(face_info_list, key=lambda x: (x["bbox"][2] - x["bbox"][0]) * (x["bbox"][3] - x["bbox"][1]))
|
| 195 |
face_kps = draw_kps(pose_image, face_info["bbox"])
|
| 196 |
-
|
| 197 |
width, height = face_kps.size
|
| 198 |
|
| 199 |
control_mask = np.zeros([height, width, 3], dtype=np.uint8)
|
|
@@ -247,7 +246,7 @@ class EndpointHandler:
|
|
| 247 |
def convert_from_image_to_cv2(self, img: Image) -> np.ndarray:
|
| 248 |
return cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)
|
| 249 |
|
| 250 |
-
def resize_img(self, input_image, max_side=1280, min_side=1024, size=None, pad_to_max_side=False, mode=
|
| 251 |
w, h = input_image.size
|
| 252 |
if size is not None:
|
| 253 |
w_resize_new, h_resize_new = size
|
|
|
|
| 193 |
|
| 194 |
face_info = max(face_info_list, key=lambda x: (x["bbox"][2] - x["bbox"][0]) * (x["bbox"][3] - x["bbox"][1]))
|
| 195 |
face_kps = draw_kps(pose_image, face_info["bbox"])
|
|
|
|
| 196 |
width, height = face_kps.size
|
| 197 |
|
| 198 |
control_mask = np.zeros([height, width, 3], dtype=np.uint8)
|
|
|
|
| 246 |
def convert_from_image_to_cv2(self, img: Image) -> np.ndarray:
|
| 247 |
return cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR)
|
| 248 |
|
| 249 |
+
def resize_img(self, input_image, max_side=1280, min_side=1024, size=None, pad_to_max_side=False, mode=Image.BILINEAR, base_pixel_number=64):
|
| 250 |
w, h = input_image.size
|
| 251 |
if size is not None:
|
| 252 |
w_resize_new, h_resize_new = size
|