`KeypointAwareCrop`: uniform sampling when no keypoints are present by n-poulsen · Pull Request #2801 · DeepLabCut/DeepLabCut

Addresses issue #2769. When all keypoints labeled in an image are augmented outside of the image (e.g. they are close to the edge and a rotation is applied), no keypoints are left. Then, density-based sampling of the crop center fails as there are no keypoints to sample from.

Address a few other typos when it comes to image augmentation:

  • When creating the Affine transform, the translation parameter must be given as (-translation, translation)
  • Keypoints should be padded with 0s (not visible) and not -1 (not defined)