You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_recall.py 1.4 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import numpy as np
  2. from mmdet.core.evaluation.recall import eval_recalls
  3. det_bboxes = np.array([
  4. [0, 0, 10, 10],
  5. [10, 10, 20, 20],
  6. [32, 32, 38, 42],
  7. ])
  8. gt_bboxes = np.array([[0, 0, 10, 20], [0, 10, 10, 19], [10, 10, 20, 20]])
  9. gt_ignore = np.array([[5, 5, 10, 20], [6, 10, 10, 19]])
  10. def test_eval_recalls():
  11. gts = [gt_bboxes, gt_bboxes, gt_bboxes]
  12. proposals = [det_bboxes, det_bboxes, det_bboxes]
  13. recall = eval_recalls(
  14. gts, proposals, proposal_nums=2, use_legacy_coordinate=True)
  15. assert recall.shape == (1, 1)
  16. assert 0.66 < recall[0][0] < 0.667
  17. recall = eval_recalls(
  18. gts, proposals, proposal_nums=2, use_legacy_coordinate=False)
  19. assert recall.shape == (1, 1)
  20. assert 0.66 < recall[0][0] < 0.667
  21. recall = eval_recalls(
  22. gts, proposals, proposal_nums=2, use_legacy_coordinate=True)
  23. assert recall.shape == (1, 1)
  24. assert 0.66 < recall[0][0] < 0.667
  25. recall = eval_recalls(
  26. gts,
  27. proposals,
  28. iou_thrs=[0.1, 0.9],
  29. proposal_nums=2,
  30. use_legacy_coordinate=False)
  31. assert recall.shape == (1, 2)
  32. assert recall[0][1] <= recall[0][0]
  33. recall = eval_recalls(
  34. gts,
  35. proposals,
  36. iou_thrs=[0.1, 0.9],
  37. proposal_nums=2,
  38. use_legacy_coordinate=True)
  39. assert recall.shape == (1, 2)
  40. assert recall[0][1] <= recall[0][0]

No Description

Contributors (3)