Skip to content

Minor bug: pose.normalize can divide by zero, filling data with nan values #146

@cleong110

Description

@cleong110

When working on tests for distances I discovered this, because I was setting the position for all keypoints to be 0. But this could also happen if the two chosen keypoints happen to be in the same location, or the mean distance somehow otherwise ends up being zero.

https://github.com/sign-language-processing/pose/blob/master/src/python/pose_format/pose.py#L120

Obviously this is very unlikely, but if it does happen it fills the body.data with nan.

/pose/src/python/pose_format/pose.py:123: RuntimeWarning: divide by zero encountered in divide
    scale = scale_factor / mean_distance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions