MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / run

Method run

PATH/core/testers/reid_tester.py:205–227  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

203 return all_features, all_labels, all_camera_ids
204
205 def run(self):
206 config = self.config
207 ginfo = self.ginfo
208 tmp = self.tmp
209
210 query_all_features, query_all_labels, query_all_camera_ids = self.extract(self.query_loader)
211 gallery_all_features, gallery_all_labels, gallery_all_camera_ids = self.extract(self.gallery_loader)
212
213 dist.barrier()
214 num_query = len(query_all_features)
215
216 evaluator = R1_mAP_eval(num_query, max_rank=50, feat_norm=True)
217 evaluator.reset()
218
219 evaluator.update((query_all_features, query_all_labels, query_all_camera_ids))
220 evaluator.update((gallery_all_features, gallery_all_labels, gallery_all_camera_ids))
221
222 cmc, mAP, _, _, _, _, _ = evaluator.compute()
223 print("Validation Results ")
224 print("mAP: {:.1%}".format(mAP))
225 for r in [1, 5, 10]:
226 print("CMC curve, Rank-{:<3}:{:.1%}".format(r, cmc[r - 1]))
227 dist.barrier()

Callers

nothing calls this directly

Calls 5

extractMethod · 0.95
resetMethod · 0.95
updateMethod · 0.95
computeMethod · 0.95
R1_mAP_evalClass · 0.85

Tested by

no test coverage detected