Enhancement/add obb support confusion matrix#1845
Enhancement/add obb support confusion matrix#1845AshAnand34 wants to merge 3 commits intoroboflow:developfrom
Conversation
soumik12345
left a comment
There was a problem hiding this comment.
Hi @AshAnand34, thanks for the PR!
Please make sure the tests are passing and not broken.
| from supervision.metrics.detection import ConfusionMatrix | ||
|
|
||
|
|
||
| def test_confusion_matrix_with_obb(): |
There was a problem hiding this comment.
This test case is not passing with the current code.
| classes: List[str], | ||
| conf_threshold: float = 0.3, | ||
| iou_threshold: float = 0.5, | ||
| use_oriented_boxes: bool = False, |
There was a problem hiding this comment.
This option should also be supported for ConfusionMatrix.benchmark.
|
Excellent initiative on adding OBB support to confusion matrix evaluation! This enhancement addresses a critical gap for oriented object detection benchmarking. The implementation approach is solid and follows good software engineering practices. Technical Assessment:
Technical Recommendations:
This enhancement will significantly benefit the computer vision community working with oriented detection tasks. The approach aligns well with modern evaluation practices. Best regards, |
Description
This pull request introduces support for evaluating oriented bounding boxes (OBBs) in the confusion matrix calculations within the
supervisionlibrary. The changes include adding a new parameter to enable OBB support, modifying the IoU calculation logic, and adding comprehensive tests to validate the functionality.Enhancements to IoU and Confusion Matrix Calculations:
use_oriented_boxesparameter to thefrom_detections,from_tensors, andevaluate_detection_batchmethods, allowing users to toggle between axis-aligned and oriented bounding box IoU calculations.oriented_box_iou_batchwhenuse_oriented_boxesis set toTrue. This ensures accurate IoU calculations for OBBs.Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
Added a new test file,
test/metrics/test_confusion_matrix_obb.py, to validate the confusion matrix functionality with and without OBB support. These tests include scenarios for perfect matches and slight offsets between predictions and ground truth.Docs
from_detectionsmethod's docstring to demonstrate how to use theuse_oriented_boxesparameter with both axis-aligned and oriented bounding boxes.