maxbbraun / thermal-face

Fast face detection in thermal images
MIT License
68 stars 13 forks source link

Is there a way to have a .pb version of the model? #10

Closed CarolusM closed 4 years ago

CarolusM commented 4 years ago

Hi,

First of all congrats for the awesome project you created. Very appropriate for the current times... :D I am doing some experiments with this Flir camera and a Raspberry and your project works great! The model is able to find my face in the image.

Now I am planning to do some modifications and would like to have a .pb version of the model, instead of the .tflite one. Do you have this .pb version? If so I would be grateful if you could send it to me

Congrats again for the great project. Cheers!

maxbbraun commented 4 years ago

Here you go!

thermal_face_pb.zip

Note that I haven't tested this.

CarolusM commented 4 years ago

Thanks for the file. Unfortunately it is not working for me. If I try to load it with tensorflow with with tf.gfile.GFile(path_to_pb, "rb") as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) I get an error message when trying to parse it google.protobuf.message.DecodeError: Error parsing message

I inspected the .pb file with Netron and it seems to be broken because I get weird information: problem_pb_1

Did you export the .pb after training or just convert it from the .tflite? Your feedback will be great to me in order to know if it is reasonable trying to fix the conversion from .tflite to .pb (apparently it is not a straightforward task) or if it is a better choice to retrain the whole model and save it to .pb myself.

maxbbraun commented 4 years ago

Did you export the .pb after training or just convert it from the .tflite?

This came directly from Cloud AutoML using the Export your model as a TF Saved Model to run on a Docker container option.