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

Function calculate_R_precision

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

Source from the content-addressed store, hash-verified

35
36
37def calculate_R_precision(embedding1, embedding2, top_k, sum_all=False):
38 dist_mat = euclidean_distance_matrix(embedding1, embedding2)
39 argmax = np.argsort(dist_mat, axis=1)
40 top_k_mat = calculate_top_k(argmax, top_k)
41 if sum_all:
42 return top_k_mat.sum(axis=0)
43 else:
44 return top_k_mat
45
46
47def calculate_matching_score(embedding1, embedding2, sum_all=False):

Callers

nothing calls this directly

Calls 2

calculate_top_kFunction · 0.85

Tested by

no test coverage detected