From 5efe61cdc3bed99edc287395211ef2f5af2b152d Mon Sep 17 00:00:00 2001 From: natanielruiz <nruiz9@gatech.edu> Date: 星期一, 30 十月 2017 08:32:38 +0800 Subject: [PATCH] Dlib detection for video. --- code/test_on_video.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/code/test_on_video.py b/code/test_on_video.py index c2e97db..7c51348 100644 --- a/code/test_on_video.py +++ b/code/test_on_video.py @@ -126,6 +126,7 @@ ret,frame = video.read() if ret == False: break + cv2_frame = cv2.cvtColor(frame,cv2.COLOR_BGR2RGB) while True: x_min, y_min, x_max, y_max = int(float(line[1])), int(float(line[2])), int(float(line[3])), int(float(line[4])) @@ -145,7 +146,7 @@ x_max = min(frame.shape[1], x_max) y_max = min(frame.shape[0], y_max) # Crop face loosely - img = frame[y_min:y_max,x_min:x_max] + img = cv2_frame[y_min:y_max,x_min:x_max] img = Image.fromarray(img) # Transform -- Gitblit v1.8.0