-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Implement Distance-Based Detection Matching in DetectionMetrics #1463
[Enhancement] Implement Distance-Based Detection Matching in DetectionMetrics #1463
Conversation
Thanks for your PR. It looks like your PR contains commits that are not signed. We required all commits in the PR to be signed. You can use this suggestion to address that: #1465 (comment) Maybe I'm missing something, but the whole idea of the PR is to allow using some other metric when matching pred vs gt boxes. So I have few questions regarding this:
I'm just not convinced this feature would be relevant for many users. |
Thank you for your feedback, and I apologize for the oversight regarding the signed commits. I will address this as soon as possible by signing all the commits in the PR according to the repository's guidelines. I will also review the suggestions in #1465 (comment) to ensure compliance. Regarding your queries about the use of different metrics for bounding box similarity, here are my thoughts: 1. Use Cases for Different Metrics:
2. References to Papers/Projects:As an example of custom metrics we can look at article titled "A Comparative Analysis of Object Detection Metrics with a Companion Open-Source Toolkit" by Rafael Padilla, Wesley L. Passos, Thadeu L. B. Dias, Sergio L. Netto, and Eduardo A. B. da Silva, provides a comprehensive overview of the most relevant evaluation methods used in object detection competitions.
3. Relevance of the Feature:While the relevance of this feature might take time to become apparent, providing the flexibility to use different metrics can cater to a wider range of use cases and user needs. |
…ics (Deci-AI#1463) - Introduced a new subclass, DetectionMetricsDistanceBased, to implement distance-based definitions of true positives, enhancing the existing DetectionMetrics class. - Developed distance-based detection matching using Euclidean and Manhattan distance metrics, allowing for more versatile and accurate object detection evaluations. - Added unit tests to ensure the reliability and accuracy of the new distance-based detection matching methodologies. - Maintained backward compatibility by implementing IoUMatching and introduced DistanceMatching for new distance-based matching strategies. - Refactored and cleaned up the code for better readability and compliance with coding standards, including applying Black for formatting.
79e2d5c
to
1487382
Compare
@DimaBir I would like to proceed with this PR and get it merged. Can you please fix the merge conflict? |
Awesome, thanks! |
Hi @BloodAxe, thanks for pointing this out. I will do np, tomorrow is it okay? I have a few meetings to attend today 🫤 |
@DimaBir thanks for updating PR. Assuming build passes the overall PR looks good to me except a few inline comments I left. Nothing serious, mostly docs improvement. |
Feel free to proceed with whatever pace is comfortable for you :) No rush here and thanks for your contribution! |
Sure @BloodAxe I will fix everything and fix commits to signed. |
31ad623
to
3ed7359
Compare
Done, force pushed branch with signed commits |
- Updated `compute_detection_matching` to conditionally require `iou_thresholds` only for IoU-based strategies.
Returned check if matching_strategy object is passed
- Updated `compute_img_detection_matching` to conditionally get thresholds using matching_strategy get_thresholds() method. Note: Since thresholds passed via matching_strategy class, consider to remove iou_thresholds param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull Request Description
This pull request introduces enhancements and additions related to distance-based metrics in the
DetectionMetrics
class. The main changes include:DetectionMetricsDistanceBased
class has been added to support distance-based metrics for object detection.Abstract base class
DetectionMatching
, which defines the interface for matching implementations.DetectionMetrics
class has been extended to incorporate distance-based metrics when calculating precision, recall, F1, and mAP.These changes improve the capabilities of the metrics calculation for object detection tasks, allowing users to analyze detection performance using distance-based criteria. Below are the details of the changes made:
Changes Made
DetectionMetricsDistanceBased
class, which extends the existingDetectionMetrics
class to support distance-based metrics.DetectionMetrics
class to accept distance metric definitions and thresholds.compute
method in both classes to calculate metrics based on the results of distance-based matching when usingDetectionMetricsDistanceBased.
DetectionMatching
, which defines the interface for matching implementations. It includes abstract methods for getting thresholds and computing metrics for targets and crowd targets.IoUMatching
class to maintain backward compatibility with IoU-based metrics.DistanceMatching
class for computing distance-based matching between predictions and targets.Proposed Changes
Testing
This PR is ready for review and feedback. I would greatly appreciate your suggestions and suggestions for improvement.