-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add position information to PointsCategories #1695
base: develop
Are you sure you want to change the base?
Add position information to PointsCategories #1695
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1695 +/- ##
===========================================
+ Coverage 81.19% 81.21% +0.01%
===========================================
Files 283 284 +1
Lines 33005 33035 +30
Branches 5309 5313 +4
===========================================
+ Hits 26798 26828 +30
Misses 4753 4753
Partials 1454 1454
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
positions = list(map(float, positions)) | ||
except (TypeError, ValueError): | ||
raise ValueError( | ||
f"Cannot convert {attribute.name} to list of floats. Check your input data." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is attribute referring to here?
Could you please add the params and return to the doc string, and type hinting please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attribute
is a mandatory argument for this validator method, that gets passed to the method internally by the attr
library. It contains some meta information about the to be validated attribute (in this case positions
), such as name, expected type and default value. I added type annotations and some refactoring to make it more clear.
Summary
This PR adds optional position information as meta-info for (key)point annotations. The position information can be used to define one or multiple default relative positions of a set of keypoints, for example a set of default human poses (standing, running etc) for human keypoint detection datasets. This type of meta-information about points data is useful in annotation tools.
Changes
positions
attribute toPointsCategories.Category
class. Similar to thePoints
annotation type, the positions are represented as a list of floats in the format[x1, y1, x2, y2, ..., xn, yn]
. The positions are optional and default to an empty list.Category
constructor. Also validates if the number of position coordinates is the same as the number of labels.PointsCategories
instance is always normalized.How to test
Add some position information to the
PointsCategories
instance of a keypoint detection dataset, then try export and importing the dataset.Checklist
License
Feel free to contact the maintainers if that's a concern.