kelvins / lbph

Local Binary Patterns Histograms (LBPH) implementation in Go
https://goo.gl/HkovdB
MIT License
54 stars 13 forks source link

[ Question ] Is there any way to save the trained model? #5

Open AthanatiusC opened 4 years ago

AthanatiusC commented 4 years ago

hello, i'm trying to implement your library to my project with 24000 faces which takes a long time to train every time i start the application. so i there any way i could save the trained model into a file and load it back?

Thank you

kelvins commented 4 years ago

Hello @AthanatiusC, I don't think it is possible right now.

The "trained model" (the histograms calculated) is stored by the trainingData variable, but this is an unexported identifier.

I believe one way would be to turn this identifier "public" so you could save and load data freely, maybe using some pickling strategy.

Sorry, I don't have time to do this change right now (and to be honest, my Go skills are rusty) but feel free to open a PR to add it.

1ycx commented 4 years ago

@kelvins Is there specific way to save a model ? Or we automate the saving/pickling of the trainingData variable ?

kelvins commented 4 years ago

@Kogam22, this project was initially developed for study purposes and I haven't thought about model serialization. I believe we could keep the model state by saving/loading the trainingData variable.