Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emalagoli92/od-metrics
Python library for Object Detection metrics.
https://github.com/emalagoli92/od-metrics
average-precision bounding-box bounding-boxes coco-api coco-dataset computer-vision deep-learning deep-neural-networks deeplearning iou iou-calculation machinelearning mean-average-precision mean-average-recall metrics neural-networks object-detection object-detection-metrics object-detection-model vision
Last synced: about 2 months ago
JSON representation
Python library for Object Detection metrics.
- Host: GitHub
- URL: https://github.com/emalagoli92/od-metrics
- Owner: EMalagoli92
- License: mit
- Created: 2023-12-17T16:28:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-22T10:34:15.000Z (8 months ago)
- Last Synced: 2024-04-22T11:43:38.401Z (8 months ago)
- Topics: average-precision, bounding-box, bounding-boxes, coco-api, coco-dataset, computer-vision, deep-learning, deep-neural-networks, deeplearning, iou, iou-calculation, machinelearning, mean-average-precision, mean-average-recall, metrics, neural-networks, object-detection, object-detection-metrics, object-detection-model, vision
- Language: Python
- Homepage: https://emalagoli92.github.io/OD-Metrics/
- Size: 1.12 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
A python library for Object Detection metrics.
## Why OD-Metrics?
- **User-friendly**: simple to set and simple to use;
- **Highly Customizable**: every parameters that occur in the definition of `mAP`
and `mAR` can be set by user to custom values;
- **Compatibility with [COCOAPI](https://github.com/cocodataset/cocoapi)**: each
calculated metric is tested to coincide with COCOAPI metrics.## Supported Metrics
Supported metrics include `mAP` (Mean Average Precision), `mAR` (Mean Average Recall)
and `IoU` (Intersection over Union).## Documentation
For help, usage and API reference, please refer to [Documentation](https://emalagoli92.github.io/OD-Metrics/)## Try live Demo
Try OD-Metrics samples [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/EMalagoli92/OD-metrics/HEAD?labpath=samples%2Fsamples.ipynb)
## Installation
Install from PyPI
```
pip install od-metrics
```
Install from Github
```
pip install git+https://github.com/EMalagoli92/OD-Metrics
```## Simple Example
``` python
from od_metrics import ODMetrics# Ground truths
y_true = [
{ # image 1
"boxes": [[25, 16, 38, 56], [129, 123, 41, 62]],
"labels": [0, 1]
},
{ # image 2
"boxes": [[123, 11, 43, 55], [38, 132, 59, 45]],
"labels": [0, 0]
}
]# Predictions
y_pred = [
{ # image 1
"boxes": [[25, 27, 37, 54], [119, 111, 40, 67], [124, 9, 49, 67]],
"labels": [0, 1, 1],
"scores": [.88, .70, .80]
},
{ # image 2
"boxes": [[64, 111, 64, 58], [26, 140, 60, 47], [19, 18, 43, 35]],
"labels": [0, 1, 0],
"scores": [.71, .54, .74]
}
]metrics = ODMetrics()
output = metrics.compute(y_true, y_pred)
print(output)
"""
{'mAP@[.5 | all | 100]': 0.2574257425742574,
'mAP@[.5:.95 | all | 100]': 0.10297029702970294,
'mAP@[.5:.95 | large | 100]': -1.0,
'mAP@[.5:.95 | medium | 100]': 0.10297029702970294,
'mAP@[.5:.95 | small | 100]': -1.0,
'mAP@[.75 | all | 100]': 0.0,
'mAR@[.5 | all | 100]': 0.25,
'mAR@[.5:.95 | all | 100]': 0.1,
'mAR@[.5:.95 | all | 10]': 0.1,
'mAR@[.5:.95 | all | 1]': 0.1,
'mAR@[.5:.95 | large | 100]': -1.0,
'mAR@[.5:.95 | medium | 100]': 0.1,
'mAR@[.5:.95 | small | 100]': -1.0,
'mAR@[.75 | all | 100]': 0.0,
'classes': [0, 1],
'n_images': 2}
"""
```## Aknowledgment
- [TorchMetrics](https://github.com/Lightning-AI/torchmetrics)
- [COCO API](https://github.com/cocodataset/cocoapi)
- [Object-Detection-Metrics](https://github.com/rafaelpadilla/Object-Detection-Metrics)## License
This work is made available under the [MIT License](https://github.com/EMalagoli92/OD-Metrics/blob/main/LICENSE)