Skip to content
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

Python version (deepstream.py) throws TypeErrors for keypoints with negative coordinates #7

Open
hhackbarth opened this issue Oct 21, 2023 · 0 comments

Comments

@hhackbarth
Copy link

In some cases it may occur that theestimated joint keypoints provided by the model have negative coordinates.

In this case in the function parse_pose from_meta() the setting of the circle_params with xc and yc as well as the setting of the line_params with x1, y1,x2, y2 will throw a TypeError. Setting these params to negative values is not allowed.

My suggestion is to make sure, the given coordinates are not negative like:
xc = max(0, int((data[i * 3 + 0] - pad_x) / gain))
yc = max(0, int((data[i * 3 + 1] - pad_y) / gain))
instead of:
xc = int((data[i * 3 + 0] - pad_x) / gain)
yc = int((data[i * 3 + 1] - pad_y) / gain)

Same for the calculation of x1, x2, y1, y2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant