Skip to content

shape_predictor: allow dpoint as training input #2183

Open

Description

@ejoebstl

Currently, the shape predictor training example showcases how to provide training and test data using integer coordinates.

Hoever, I would like to train a shape predictor using float coordinate pairs. I hope to gain increased precision by doing so. Since the shape predictor is also giving float numbers as output, I would assume that this should be possible.

However, there is no documentation to be found on the input format.

I'm happy to extend the documentation as soon as I know how this works.

Activity

  1. davisking commented on Sep 19, 2020

    @davisking
    Owner

    This isn't supported by the current API. There isn't any particularly good reason, it's just how the code is setup. It could use floating point coordinates. I am somewhat skeptical that someone can label landmarks to sub-pixel accuracy though. Do you really have a problem domain where humans, or whatever it is that generates the labels, somehow really knows the location of the landmarks to sub-pixel accuracy?

  2. ejoebstl commented on Sep 20, 2020

    @ejoebstl
    Author

    Thanks for getting back.

    I am using this dataset, which supplies float coordinates. The images are quite small, therefore I assumed it might make a difference.

  3. davisking commented on Sep 21, 2020

    @davisking
    Owner
  4. changed the title [-][Documentation] Document shape_predictor training input[/-] [+]shape_predictor: allow dpoint as training input[/+] on Oct 16, 2020
  5. dlib-issue-bot commented on Nov 21, 2020

    @dlib-issue-bot
    Collaborator

    Warning: this issue has been inactive for 35 days and will be automatically closed on 2020-11-30 if there is no further activity.

    If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

  6. dlib-issue-bot commented on Nov 29, 2020

    @dlib-issue-bot
    Collaborator

    Warning: this issue has been inactive for 43 days and will be automatically closed on 2020-11-30 if there is no further activity.

    If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

  7. dlib-issue-bot commented on Dec 1, 2020

    @dlib-issue-bot
    Collaborator

    Notice: this issue has been closed because it has been inactive for 45 days. You may reopen this issue if it has been closed in error.

  8. guilbut commented on May 21, 2021

    @guilbut

    Hi !
    I am developing a software for which I need sub-pixel tracking with coordinates of points in float. Unfortunately the float rounding at the output of the shape predictor causes a jitter that is far too important for my needs. For the learning I have a database annotated very precisely with a sub-pixel accuracy (maybe at 1/4 of pixels). I managed to give numpy matrices with floats as input (hoping they are not truncated internally ), but the shape predictor seems to only output integer points, contrary to the statement of "Since the shape predictor is also giving float numbers as output".
    I unfortunately don't have the level in C ++ to do the modification cleanly and to offer a pool request. Does one of you two already tried to start modifying the code to allow dpoint as input to the training and as output of the predictor?
    Thanks !

  9. davisking commented on May 24, 2021

    @davisking
    Owner

    Yeah this would be a reasonable thing to upgrade. If someone wants to go replace point with dpoint in the right places and make any necessary attendant adjustments that would be cool. It has to be done in a way that's backwards compatible with old code, but that shouldn't be hard though.

  10. akulabs8 commented on Jan 19, 2025

    @akulabs8

    Is there still anything can be done on this?

  11. Infinage commented on Jul 23, 2025

    @Infinage
    Contributor

    Hi @davisking, I have made a PR with the changes. Kindly review and let me know your thoughts.

    All units tests pass successfully. However, dlib/image_processing/object_detector.h still uses parts passed in as std::vector. Modifying this to use dpoint causes the test_face to fail for some reason. Would be happy to investigate or make additional changes with some guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions