MCPcopy Create free account
hub / github.com/MotrixLab/MotionDiffuse / calculate_matching_score

Function calculate_matching_score

text2motion/utils/metrics.py:47–56  ·  view source on GitHub ↗
(embedding1, embedding2, sum_all=False)

Source from the content-addressed store, hash-verified

45
46
47def calculate_matching_score(embedding1, embedding2, sum_all=False):
48 assert len(embedding1.shape) == 2
49 assert embedding1.shape[0] == embedding2.shape[0]
50 assert embedding1.shape[1] == embedding2.shape[1]
51
52 dist = linalg.norm(embedding1 - embedding2, axis=1)
53 if sum_all:
54 return dist.sum(axis=0)
55 else:
56 return dist
57
58
59

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected