def get_frame_prediction(self):
ret, frame = self.cap.read()
# if we get a frame
if not ret:
raise IOError('No image found!')
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
frame = cv2.resize(frame, (self.width, self.height), interpolation=cv2.INTER_CUBIC)
frame = frame.astype('uint8')
return frame
# Normalizes inputs so we don't have to worry about weird
# characters e.g. \r\n
评论列表
文章目录