@@ -22,11 +22,13 @@ class main(): | |||
def video(self): | |||
cap = cv2.VideoCapture(0) | |||
print("VideoCapture") | |||
while len(self.BUFFER) < self.BUFFER_LEN: | |||
start_time = time.time() | |||
ret, frame = cap.read() | |||
frame = cv2.resize(frame, (500, 500)) | |||
# why resize if we later call a pyramid? | |||
self.BUFFER.append(frame) | |||
stop_time = time.time() | |||
self.FPS_BUFFER.append(stop_time-start_time) |
@@ -27,7 +27,9 @@ def read_video(path): | |||
for (x, y, w, h) in face_rects: | |||
roi_frame = img[y:y + h, x:x + w] | |||
if roi_frame.size != img.size: | |||
roi_frame = cv2.resize(roi_frame, (500, 500)) | |||
#duplicate resize | |||
frame = np.ndarray(shape=roi_frame.shape, dtype="float") | |||
frame[:] = roi_frame * (1. / 255) | |||
video_frames.append(frame) |