From 35aeb598bcda15868a8c69f6a307f75d62aa0132 Mon Sep 17 00:00:00 2001 From: weishengyu Date: Sat, 5 Jun 2021 14:23:14 +0800 Subject: [PATCH] remove "remove" in metrics --- ppcls/metric/metrics.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ppcls/metric/metrics.py b/ppcls/metric/metrics.py index 0301ac05..d0044daf 100644 --- a/ppcls/metric/metrics.py +++ b/ppcls/metric/metrics.py @@ -120,11 +120,7 @@ def get_metrics(indices, num_q, num_g, q_pids, g_pids, max_rank=50): num_valid_q = 0 matches = (g_pids[indices] == q_pids[:, np.newaxis]).astype(np.int32) for q_idx in range(num_q): - q_pid = q_pids[q_idx] - order = indices[q_idx] - remove = g_pids[order] == q_pid - keep = np.invert(remove) - raw_cmc = matches[q_idx][keep] + raw_cmc = matches[q_idx] if not np.any(raw_cmc): continue cmc = raw_cmc.cumsum() -- GitLab