def frame_to_vect(frame):
# tranform rgb image for CNN input layer
H,W = frame.shape[:2]
frame = sp.asarray(frame, dtype = sp.float16) / 255.0
features = frame.transpose(2,0,1).reshape(3, H, W)
return features
评论列表
文章目录