-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to train my own dlib_face_recognition_resnet_model_v1.dat #11
Comments
@davisking I'm also interested if you're willing to release the dataset. In any case, I understand that it involved a lot of work. |
You can use the trillion faces or ms celeb datasets. They are already available and very large. |
Davis, is there a python API for training your own model? Thank you, sir! Dlib is amazing. |
No |
@davisking , I don't know how to train my dlib_face_recognition_resnet_model_v1 model, can you give me some methods! |
This example program goes into the details: http://dlib.net/dnn_metric_learning_on_images_ex.cpp.html |
@davisking Just to be sure, is that C++ code the one used to train this model? I'd like to transfer learn on my own dataset and want to be sure I'm starting from the right place |
Also we’re rhe input images aligned centered cropped etc or just resized to 150x150 with a crop from a face finding model? Also be helpful to know this just in terms of using the base model - I see the sample code that uses it does this so I presume it was trained that way As well |
The notes on how this model was trained are in the example program that shows how to use it: http://dlib.net/dnn_face_recognition_ex.cpp.html |
Ah thanks for that! Very helpful.
I managed to get it to train a few steps on some images of my own. However
I couldn’t load it into a net_type because the saved weights have the
affine layers while the net_type has batchnorm layers. Though I see it auto
converts from batchnorm to affine when saving, I wasn’t able to get it to
auto convert from affine to batchnorm to keep training. So I have been
training the anet_type directly.
Is there a way to retrieve the net_type from the saved weights on the repo?
Or are part of the batchnorm parameters lost when saving the model meaning
I can’t transfer learn it?
…On Thu, Oct 31, 2019 at 12:02 AM Davis E. King ***@***.***> wrote:
The notes on how this model was trained are in the example program that
shows how to use it: http://dlib.net/dnn_face_recognition_ex.cpp.html
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11?email_source=notifications&email_token=AAAKQ2OQY3ISUSKPO7BLFTDQRIOC5A5CNFSM4GMJTZUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECWEUAY#issuecomment-548162051>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAKQ2IQAVDMXCVBUR3ZWQLQRIOC5ANCNFSM4GMJTZUA>
.
|
Some things are lost when converting from batch norm to affine. Save in
batch norm form when doing training.
…On Thu, Oct 31, 2019 at 9:17 AM Claudiu ***@***.***> wrote:
Ah thanks for that! Very helpful.
I managed to get it to train a few steps on some images of my own. However
I couldn’t load it into a net_type because the saved weights have the
affine layers while the net_type has batchnorm layers. Though I see it auto
converts from batchnorm to affine when saving, I wasn’t able to get it to
auto convert from affine to batchnorm to keep training. So I have been
training the anet_type directly.
Is there a way to retrieve the net_type from the saved weights on the repo?
Or are part of the batchnorm parameters lost when saving the model meaning
I can’t transfer learn it?
On Thu, Oct 31, 2019 at 12:02 AM Davis E. King ***@***.***>
wrote:
> The notes on how this model was trained are in the example program that
> shows how to use it: http://dlib.net/dnn_face_recognition_ex.cpp.html
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <
#11?email_source=notifications&email_token=AAAKQ2OQY3ISUSKPO7BLFTDQRIOC5A5CNFSM4GMJTZUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECWEUAY#issuecomment-548162051
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AAAKQ2IQAVDMXCVBUR3ZWQLQRIOC5ANCNFSM4GMJTZUA
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11?email_source=notifications&email_token=ABPYFR6IRGWI4PNRKTODKX3QRLLFRA5CNFSM4GMJTZUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECXXJLI#issuecomment-548369581>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPYFR3L2HVRKDUDMGM23LLQRLLFRANCNFSM4GMJTZUA>
.
|
Is there any way to get the batch norm form of the model on the repo? Or is
this reserved for secret sauce not for public consumption? :). I understand
if it’s the latter.
If it’s not available I suppose we can’t transfer learn it as-is. If we
load weights and swap out the affine for a random batch norm it seems
that’d lose all the learning in first few steps. Best option seems to be to
keep the affine as-is. Let me know what you think.
On Thu, Oct 31, 2019 at 11:52 PM Davis E. King <[email protected]>
wrote:
… Some things are lost when converting from batch norm to affine. Save in
batch norm form when doing training.
On Thu, Oct 31, 2019 at 9:17 AM Claudiu ***@***.***> wrote:
> Ah thanks for that! Very helpful.
>
> I managed to get it to train a few steps on some images of my own.
However
> I couldn’t load it into a net_type because the saved weights have the
> affine layers while the net_type has batchnorm layers. Though I see it
auto
> converts from batchnorm to affine when saving, I wasn’t able to get it to
> auto convert from affine to batchnorm to keep training. So I have been
> training the anet_type directly.
>
> Is there a way to retrieve the net_type from the saved weights on the
repo?
> Or are part of the batchnorm parameters lost when saving the model
meaning
> I can’t transfer learn it?
>
> On Thu, Oct 31, 2019 at 12:02 AM Davis E. King ***@***.***
>
> wrote:
>
> > The notes on how this model was trained are in the example program that
> > shows how to use it: http://dlib.net/dnn_face_recognition_ex.cpp.html
> >
> > —
> > You are receiving this because you commented.
> > Reply to this email directly, view it on GitHub
> > <
>
#11?email_source=notifications&email_token=AAAKQ2OQY3ISUSKPO7BLFTDQRIOC5A5CNFSM4GMJTZUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECWEUAY#issuecomment-548162051
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/AAAKQ2IQAVDMXCVBUR3ZWQLQRIOC5ANCNFSM4GMJTZUA
> >
> > .
> >
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#11?email_source=notifications&email_token=ABPYFR6IRGWI4PNRKTODKX3QRLLFRA5CNFSM4GMJTZUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECXXJLI#issuecomment-548369581
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ABPYFR3L2HVRKDUDMGM23LLQRLLFRANCNFSM4GMJTZUA
>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11?email_source=notifications&email_token=AAAKQ2OIPL4XCVLKHUDYJTLQRNVVVA5CNFSM4GMJTZUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECZS6HQ#issuecomment-548613918>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAKQ2OEDSXHAB65ZNDRVT3QRNVVVANCNFSM4GMJTZUA>
.
|
You could copy the layer parameters into a network with batch norm layers and go in and manually fill in the missing batch norm parameters with something reasonable. |
Does anyone build the dlib_face_recognition_resnet_model_v1.dat with custom dataset? If Yes, Please share the method. Thanks in Advance. |
http://dlib.net/dnn_face_recognition_ex.cpp.html and
http://dlib.net/dnn_metric_learning_on_images_ex.cpp.html explain all that.
…On Wed, Sep 9, 2020 at 6:06 AM ismailpolas ***@***.***> wrote:
Does anyone build the dlib_face_recognition_resnet_model_v1.dat with
custom dataset? If Yes, Please share the method. Thanks in Advance.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPYFRZ4RB3SAR3D2ZM6KPDSE5HRNANCNFSM4GMJTZUA>
.
|
I tried Loading a custom dataset and successfully made the resnet .dat file but I'm getting this error. ERROR: Unexpected version found while deserializing dlib::input_rgb_image_sized. Please refer to the issue link given below for more detials on this error. |
How to train my own dlib_face_recognition_resnet_model_v1.dat. Please help and if possible share the python api for the same.
The text was updated successfully, but these errors were encountered: