MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / _evaluate

Function _evaluate

tests/core/inferenceutils/test_map_computation.py:251–284  ·  view source on GitHub ↗
(gt: dict[str, np.ndarray], pred: dict[str, np.ndarray])

Source from the content-addressed store, hash-verified

249
250
251def _evaluate(gt: dict[str, np.ndarray], pred: dict[str, np.ndarray]):
252 for k, v in gt.items():
253 print(20 * "-")
254 print(k)
255 print("GT")
256 print(v)
257 print("PR")
258 print(pred[k])
259
260 gt_assemblies = _to_assemblies(gt, ground_truth=True)
261 pred_assemblies = _to_assemblies(pred, ground_truth=False)
262 oks = inferenceutils.evaluate_assembly_greedy(
263 assemblies_gt=gt_assemblies,
264 assemblies_pred=pred_assemblies,
265 oks_sigma=0.1,
266 oks_thresholds=np.linspace(0.5, 0.95, 10),
267 margin=0.0,
268 symmetric_kpts=None,
269 )
270
271 num_joints = gt[list(gt.keys())[0]].shape[1]
272 coco_gt = _to_coco_ground_truth(gt, num_joints, bbox_margin=0)
273 coco_pred = _to_coco_predictions(coco_gt, pred, bbox_margin=0)
274 coco_oks = eval_coco(coco_gt, coco_pred, num_joints)
275 print(20 * "-")
276 print("dlc mAP:")
277 for k, v in oks.items():
278 print(k)
279 print(v)
280 print()
281 print(20 * "-")
282 print(f"pycocotools mAP: {coco_oks}")
283 print()
284 assert oks["mAP"] == coco_oks
285
286
287def _to_assemblies(

Calls 6

_to_assembliesFunction · 0.85
itemsMethod · 0.80
keysMethod · 0.80
_to_coco_ground_truthFunction · 0.70
_to_coco_predictionsFunction · 0.70
eval_cocoFunction · 0.70

Tested by

no test coverage detected