maxbbraun / fever

A contactless fever thermometer with auto-aim
MIT License
25 stars 12 forks source link

Does not run on CPU #6

Open gtrwebz opened 3 years ago

gtrwebz commented 3 years ago

According to maxbbraun/thermal-face the model _thermal_face_automl_edgefast.tflite should run on CPU However I tried it and it won't work.

Error code is shown below super().__init__(model_path) File "/usr/lib/python3/dist-packages/edgetpu/basic/basic_engine.py", line 92, in __init__ self._engine = BasicEnginePythonWrapper.CreateFromFile(model_path) RuntimeError: No Edge TPU device detected!

Model I use

flags.DEFINE_string('face_model', 'thermal_face_automl_edge_fast.tflite', 'The TF Lite face detection model file compiled for CPU ' 'CPU.') Per google documents edgetpu.detection.engine.DetectionEngine can run on CPU .

Is there any problem with thermal_face_automl_edge_fast.tflite ?

maxbbraun commented 3 years ago

Hi! The pure TF Lite model thermal_face_automl_edge_fast.tflite shouldn't have anything specific to Edge TPU built in, which is the case for the compiled version.

DetectionEngine seems to be able to run models not compiled for Edge TPU in my experience (but that doesn't seem to be supported according to this comment). It only seems to work, however, while an EdgeTPU is connected. There is a check for that during initialization and that's the error you're seeing.

The solution is for you to use the normal TF Lite API. See this tutorial or this sample code.

gtrwebz commented 3 years ago

Hi Max So it can not be used without an attached coral device.

Thank you

maxbbraun commented 3 years ago

The model can be used without Coral, but not using the code in this repo. It should not be difficult to rewrite it. See the comment above.