davisking / dlib-models

Trained model files for dlib example programs.
Creative Commons Zero v1.0 Universal
1.46k stars 376 forks source link

How to train not face models? #26

Open muxgt opened 4 years ago

muxgt commented 4 years ago

Hi! I've looked through Python example shape predictor and noticed that it uses separate face detector to get bounding box around face. But what if I want to train a model to predict not face but some other landmarks? How then do I use shape predictor? Where do I get neccessary bounding box? And can it be predicted by shape predictor itself?

davisking commented 4 years ago

You need to make a separate detector for whatever it is you want to find.

babylon73 commented 4 years ago

Hi Davis, I've dropped a message via e-mail (counting on a chance you'd respond), no answer yet though. In short, I have a task of classification of microorganisms, came across DLib and other brilliant resources of yours and familiarizing myself with in domain now. Could you please give and advice, how and what to examing among the DLib C++ samples/other resources in order to master the skill of training domain-specific models? Sort of a roadmap or something... I'm familiar with C++, CUDA, AI in general (Genetic Programming in particular). Thank you in advance.

davisking commented 4 years ago

I'm not sure if you are trying to detect the positions of things in images, or just classify the whole image as "an A type thing" vs "a B type thing". For classification of whole images any of the imagenet style methods is a textbook approach at this point. For that, http://dlib.net/dnn_imagenet_train_ex.cpp.html would be a good starting point.

babylon73 commented 4 years ago

Davis,

Thank you for the answer.

I have three sorts of tasks:

  1. As you put it, classify whole image as an "N type thing", where N can be pretty big (hundreds of possible classes). http://dlib.net/dnn_imagenet_train_ex.cpp.html is a good start for this.
  2. Identify positions of microorganisms on the image.
  3. Take big image, identify positions of microorganisms (task 2) and report which sorts of microorganisms were found (and how many of each type of miroorganisms were found).

Would be great if you could suggest on the tasks (2) and (3).

Thank you.

davisking commented 4 years ago

I would try this stuff for finding the positions of things: http://dlib.net/ml.html#loss_mmod_