def predict_from_cam(self, capfile='cap.jpg', reshape=(224, 224), N=5):
if self.camera is None:
self.camera = picamera.PiCamera()
# Show quick preview of what's being captured
self.camera.start_preview()
time.sleep(3)
self.camera.capture(capfile)
self.camera.stop_preview()
return self.predict_from_file(capfile)
评论列表
文章目录