如果我的模型需要 80 毫秒来处理每一帧 (12.5 fps),但相机以 30 fps 运行,CameraInference 如何处理要处理的下一帧?
它是否在处理之前抓取当前的当前帧?还是它从帧缓冲区中拉出较早的帧?
代码示例:
with PiCamera() as camera:
camera.sensor_mode = 4
camera.resolution = (1640, 1232)
camera.framerate = 30
camera.start_preview()
with CameraInference(my_model.model()) as inference:
for i, result in enumerate(inference.run()):
if i == args.num_frames:
break
print('frame: {}, dur: {}, result: {}'.format(i, result.duration_ms, result.tensors['y'].data[0]))
camera.stop_preview()