You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shape_predictor: allow dpoint as training input #2183
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.
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?
Were they annotated at a higher resolution and then downsampled?
In any case, if you want to put up a PR that switches the
full_object_detection to use dpoint instead of point (but in a way that's
reasonably backwards compatible so existing users are not bothered) that
would be cool with me.
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.
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.
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 !
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.
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.
Activity
davisking commentedon Sep 19, 2020
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?
ejoebstl commentedon Sep 20, 2020
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.
davisking commentedon Sep 21, 2020
[-][Documentation] Document shape_predictor training input[/-][+]shape_predictor: allow dpoint as training input[/+]dlib-issue-bot commentedon Nov 21, 2020
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.
dlib-issue-bot commentedon Nov 29, 2020
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.
dlib-issue-bot commentedon Dec 1, 2020
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.
guilbut commentedon May 21, 2021
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 !
davisking commentedon May 24, 2021
Yeah this would be a reasonable thing to upgrade. If someone wants to go replace
pointwithdpointin 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.akulabs8 commentedon Jan 19, 2025
Is there still anything can be done on this?
Infinage commentedon Jul 23, 2025
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.hstill uses parts passed in as std::vector. Modifying this to use dpoint causes thetest_faceto fail for some reason. Would be happy to investigate or make additional changes with some guidance.full_object_detection: API Support for dpoint (#2183) (#3095)