MCPcopy Create free account
hub / github.com/Depth2World/VLADBench / weighted_total

Function weighted_total

evaluate_utils.py:22–29  ·  view source on GitHub ↗
(data, weight_col=1, start_col=2)

Source from the content-addressed store, hash-verified

20
21
22def weighted_total(data, weight_col=1, start_col=2):
23 data = np.array(data)
24 m,n = data.shape
25 rows = slice(0, m)
26 cols = slice(start_col, None)
27 weighted_sum = np.sum(data[rows, cols].astype(float) * data[rows, weight_col].astype(float)[:, np.newaxis], axis=0) / np.sum(data[rows, weight_col].astype(float))
28 weighted_sum = ['Total',np.sum(data[rows, weight_col].astype(float))] + weighted_sum.tolist()
29 return weighted_sum
30
31
32def box_iou(boxA, boxB):

Callers 1

evaluate_vlm.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected