pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.78k stars 21.33k forks source link

pretrained weights of own data from scratch #1084

Open melonetern opened 6 years ago

melonetern commented 6 years ago

Hello everyone,

I would like to ask, is there any way to prepare my own weights of my own products. That means, I have lots of similar objects, which is not like persons, birds, dogs and general things but some customer specialized products, for example, different design of glasses. I want to short the training time by using the pretrained weights of my glasses. The trained weights and program are used for detecting the glasses with different design. If not, from when should I start with, for having my own pretrained weights, which is really specilized only for my own private stuffs, and short the training time if I have more similar objects in the futures.

Thank you so much.

lakshmankanakala commented 6 years ago

Hi, If you want to detect particular type of objects, you need to have atleast 300 images each class of object . then you have to get the bounding box's center, width and height of the object from image. to do this task you can clone this repo: https://github.com/AlexeyAB/darknet then train this prepared dataset on darknet frame work.

melonetern commented 6 years ago

Hi @lakshmankanakala ,

thank you for your answer. I have already gotten my own terminal with camera working with YOLO2 trained weights of my own data. What I want is if I can create my own pretrained weights, instead of darknet53.conv.74. Is it possible, do darknet/YOLO has that function/method, or if I want to do this, I have to do my own program from scratch?

Thank you.

DevD1092 commented 5 years ago

@melonetern @pjreddie : Any solution to the above query? I would also wish to do something similar. I have trained on my own data. And would like to use those weights as the pretrained weights for another round of training.

P.S: There is of course one work around i.e. you start the next training with the iteration number +1 (for iteration number which ended for the previous training) and include the initialization as the previously trained weights. But is this the correct method?

Thank you.

DevD1092 commented 5 years ago

Okay, this issue has already been resolved with the darknet partial command that I came across here:

https://github.com/thtrieu/darkflow/issues/14#issuecomment-262523369

You need to use the partial argument for converting your trained model into weights (specifying until which layer) that can be used as pre-trained initialization point for the next training.