Bug fixes: `find_closest_neighbors` + ellipse tracking by n-poulsen · Pull Request #2709 · DeepLabCut/DeepLabCut

This pull request makes two bug fixes:

In deeplabcut/core/crossvalutils.py - find_closest_neighbors

  • The cKDTree.query method returns n (the size of the input data) for missing nieghbors ("Missing neighbors are indicated with self.n."). This wasn't taken into account, so this value could be returned in the index list, leading to an out-of-bounds error.

In deeplabcut/core/trackingutils.py - calc_similarity_with

  • Zero division as we didn't check the height/width of ellipses was greater than 0