5

I'm trying to create an XML file by exploiting the imglab tool provided by dlib. I have a dataset of 21 images each with a single face. I must affix on each 68 landmarks at my leisure.

The file created with my landmarks is different from the XML file provided by dlib : namely each record is defined as a single box and should be considered as a part of the main box with containing the face.

Help me!

1
  • To do it quickly and with the inspiration from dlib/imglab, I have created it's web version. You can use 3rd party libraries to determine face and landmark points on an img that you can save in dlib xml or pts file. You can also adjust the point and box to increase the accuracy. Nov 4, 2017 at 5:15

2 Answers 2

6

Looks like you are trying to draw boxes manually around every face feature instead of using "part selection" mode

imglab -h will show you this:

--parts The display will allow image parts to be labeled. The set of allowable parts is defined by which should be a space separated list of parts.

Try this:

  1. Create xml file for some images directory

    imglab -c xml_file_name.xml /path/to/images/folder

  2. run imglab with --parts argument:

    imglab --parts "1 2 3 4 5 6 7 8" xml_file_name.xml

This will make imglab know about 8 features possible to annotate in box area

  1. After imglab opened - draw box, select it (should be blue) and right-click inside - you will get popup menu for part selection

Also consider reading help/about in imglab for using instructions

After saving xml file you will get something like this:

  <image file='1\a1.jpg'>
    <box top='26' left='33' width='78' height='73'>
      <part name='1' x='67' y='68'/>
    </box>
  </image>
10
  • my problem is now the following: I can train with a number less than 68? in the case of strongly inclined faces I can annotate my images with only visible landmarks? I would have problems in the process of training?
    – B.Taf
    May 13, 2016 at 11:44
  • you mean some faces will have 68 and other 67 featuers (example) ? or you want to train all faces with 30 features?
    – Evgeniy
    May 13, 2016 at 11:57
  • if i have some images with 30 annotation but from other images inclination is so accentuated that it can not enter all 30 landmarks, but only few of these, is this a problem for train?
    – B.Taf
    May 13, 2016 at 12:03
  • dlib has a code to exclude missing features from training, but not from predicting. With my experience it is not recommended to exlude any features from training because shapre_predictor will return all feature list every time it will be called. I recommend you to put all features to every image (even if they evrlap with other features) because it will be the way how dlib will return you the result. if the feature is not visible on image i recommend you to put it on the same place with some other feature and this way you will understand its visibility later
    – Evgeniy
    May 13, 2016 at 12:17
  • I want to register five facial images at different angles in a single planar image. This is why I need to create a .dat file that is effective in this regard. what could be the most effective landamarks for this purpose?
    – B.Taf
    May 16, 2016 at 9:52
1

Evgeniy's answer is useful but when running imglab with --parts argument, numerical labels should be like:

imglab --parts "01 02 03 04 05 06 07 08 09 10 11 12" xml_file_name.xml

Otherwise, since dlib sorts the parts by name in xml, labels will be confusing while predicting.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.