davisking/dlib

Get Dlib version used to create models

aribiere opened this issue · 2 comments

Main idea

Is there a way to get the Dlib version used to create some models ?

For example, how to find the version used to create a dense_feature_extractor ? It could be nice to check if the models where created using the right Dlib version after an improvement/bug fix was done (I think of some bug fix done in 19.21 release).

There could be a version number serialized in models as there is already a string stored and tested in dlib::check_serialized_version(). But there it only tests if the string is correct.
It could be a dlib::get_version() function which returns a std::string containing the Dlib version.

Thanks.

Anything else?

No response

You can access the version of dlib you're using from dlib/revision.h.

I guess, it's up to you to handle the versioning in the models.

You could simply do:

serialize("model.dat") << DLIB_MAJOR_VERSION << DLIB_MINOR_VERSION << DLIB_PATCH_VERSION << model;

Or build the string yourself, or whatever you'd like.

You're right. I'll do that.

Thanks,.