def preprocess_frame(image, target_height=224, target_width=224):
image = resize_frame(image, target_height, target_width)
image = skimage.img_as_ubyte(image).astype(np.float32)
# ???ILSVRC???????????BGR???
image -= np.array([103.939, 116.779, 123.68])
# ?BGR??????RGB????????????caffe????????RGB??
image = image[:, :, ::-1]
return image
评论列表
文章目录