From 1d9299d9c8b80e7371d358606e4b30e0f35b0740 Mon Sep 17 00:00:00 2001 From: F Date: Fri, 2 Nov 2018 09:55:52 +0800 Subject: [PATCH] fix input format error --- face_verify.py | 3 ++- infer_on_video.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/face_verify.py b/face_verify.py index cf5a0c96..9f6b11bb 100644 --- a/face_verify.py +++ b/face_verify.py @@ -50,7 +50,8 @@ isSuccess,frame = cap.read() if isSuccess: try: - image = Image.fromarray(frame[...,::-1]) #bgr to rgb +# image = Image.fromarray(frame[...,::-1]) #bgr to rgb + image = Image.fromarray(frame) bboxes, faces = mtcnn.align_multi(image, conf.face_limit, conf.min_face_size) bboxes = bboxes[:,:-1] #shape:[10,4],only keep 10 highest possibiity faces bboxes = bboxes.astype(int) diff --git a/infer_on_video.py b/infer_on_video.py index 356d60cb..eab999e2 100644 --- a/infer_on_video.py +++ b/infer_on_video.py @@ -56,7 +56,8 @@ while cap.isOpened(): isSuccess,frame = cap.read() if isSuccess: - image = Image.fromarray(frame[...,::-1]) #bgr to rgb +# image = Image.fromarray(frame[...,::-1]) #bgr to rgb + image = Image.fromarray(frame) try: bboxes, faces = mtcnn.align_multi(image, conf.face_limit, 16) except: