MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / _cosine_distance

Function _cosine_distance

yolox/deepsort_tracker/deepsort.py:13–17  ·  view source on GitHub ↗
(a, b, data_is_normalized=False)

Source from the content-addressed store, hash-verified

11
12
13def _cosine_distance(a, b, data_is_normalized=False):
14 if not data_is_normalized:
15 a = np.asarray(a) / np.linalg.norm(a, axis=1, keepdims=True)
16 b = np.asarray(b) / np.linalg.norm(b, axis=1, keepdims=True)
17 return 1. - np.dot(a, b.T)
18
19
20def _nn_cosine_distance(x, y):

Callers 1

_nn_cosine_distanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected