Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skalskip/onemetric
One Metrics Library to Rule Them All!
https://github.com/skalskip/onemetric
computer-vision deep-learning machine-learning metrics object-detection
Last synced: 14 days ago
JSON representation
One Metrics Library to Rule Them All!
- Host: GitHub
- URL: https://github.com/skalskip/onemetric
- Owner: SkalskiP
- License: bsd-3-clause
- Created: 2021-03-04T09:34:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-10T17:19:49.000Z (almost 3 years ago)
- Last Synced: 2024-10-10T12:08:12.020Z (about 1 month ago)
- Topics: computer-vision, deep-learning, machine-learning, metrics, object-detection
- Language: Python
- Homepage: https://skalskip.github.io/onemetric
- Size: 556 KB
- Stars: 57
- Watchers: 7
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![PyPI version](https://badge.fury.io/py/onemetric.svg)](https://badge.fury.io/py/onemetric)
![PyPI - Downloads](https://img.shields.io/pypi/dm/onemetric)
![PyPI - License](https://img.shields.io/pypi/l/onemetric)
[![codecov](https://codecov.io/gh/SkalskiP/onemetric/branch/master/graph/badge.svg?token=ZFSEYF9WN4)](https://codecov.io/gh/SkalskiP/onemetric)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/onemetric)onemetric
## Installation
* Install onemetric from PyPI (recommended):
```console
pip install --upgrade pip
pip install onemetric
```
* Install onemetric from the GitHub source:```console
git clone https://github.com/SkalskiP/onemetric.git
cd onemetric
python setup.py install
```## Example
**Figure 1.** Dataset sample, blue - ground-truth and red - detection.
### Calculate [email protected]
```python
>>> from onemetric.cv.loaders import YOLOLoader
>>> from onemetric.cv.object_detection import MeanAveragePrecision>>> model = load_model(...) # model-specific loading method
>>> data_set = YOLOLoader(
... images_dir_path=DATA_SET_IMAGES_PATH,
... annotations_dir_path=DATA_SET_ANNOTATIONS_PATH
... ).load()>>> true_batches, detection_batches = [], []
>>> for entry in data_set:
>>> detections = model(entry.get_image()) # model-specific prediction method
>>> true_batches.append(entry.get_annotations())
>>> detection_batches.append(detections)>>> mean_average_precision = MeanAveragePrecision.from_detections(
... true_batches=true_batches,
... detection_batches=detection_batches,
... num_classes=12,
... iou_threshold=0.5
... )>>> mean_average_precision.value
0.61
```### Calculate Confusion Matrix
```python
>>> confusion_matrix = ConfusionMatrix.from_detections(
... true_batches=true_batches,
... detection_batches=detection_batches,
... num_classes=12
... )>>> confusion_matrix.plot(CONFUSION_MATRIX_TARGET_PATH, class_names=CLASS_NAMES)
```
**Figure 2.** Create confusion matrix chart
## Documentation
The official documentation is hosted on Github Pages: https://skalskip.github.io/onemetric
## Contribute
Feel free to file [issues](https://github.com/SkalskiP/onemetric/issues) or [pull requests](https://github.com/SkalskiP/onemetric/pulls). **Let us know what metrics should be part of onemetric!**
## Citation
Please cite onemetric in your publications if this is useful for your research. Here is an example BibTeX entry:
```BibTeX
@MISC{onemetric,
author = {Piotr Skalski},
title = {{onemetric}},
howpublished = "\url{https://github.com/SkalskiP/onemetric/}",
year = {2021},
}
```## License
This project is licensed under the BSD 3 - see the [LICENSE][1] file for details.
[1]: https://github.com/SkalskiP/onemetric/blob/master/LICENSE