-
Notifications
You must be signed in to change notification settings - Fork 255
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
New vectorized distance functions. #211
Conversation
2549262
to
0815f94
Compare
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.
LGTM. please wait for #212 to be merged and the new release before merging this.
I would like to make a small patch-release and I feel this one is too big a change to be included in a patch
Why do we keep both What use case does the unoptimized version have? |
@dekked the unoptimized version has some validations that might be useful. This PR doesn't address the modification of the IoU distance function as a vectorized distance, that's why we don't modify it here. In #213 we are changing the optimized IoU implementation, and we will revisit these two definitions. |
74700c0
to
a98a86a
Compare
In this PR we add support for vectorized
distance_functions
to speed up Norfair. The new distances can be one ofScalarDistance
,VectorizedDistance
, andScipyDistance
. We moved the distance functions and the distances calculations (previouslyTracker._get_distances
) to the newly mentioned classes. With this new interface, we can define a variety of distances; from simple scalar distances such as the ones that we have been using until now, to custom vectorized distances that take a pair ofnp.ndarray
as input, and even default vectorized distances fromScipy
.We were careful not to break the API. The users can still define custom distances and now they can also leverage predefined vectorized distances that speed up the tracking.
Changes include:
distances.py
.Tracker._get_distances
and moved it to the distance classes.Tracker.__init__
to create instances of the new distance classes.Pending tasks:
[ x ] Change demos to use vectorized distances when possible
[ x ] Check ReID still works
[ x ] Add tests
[ x ] Review and update any deprecated documentation
[ x ] Write PR description