{"id":15645072,"url":"https://github.com/skalskip/onemetric","last_synced_at":"2026-03-01T22:38:07.998Z","repository":{"id":57448716,"uuid":"344420704","full_name":"SkalskiP/onemetric","owner":"SkalskiP","description":"One Metrics Library to Rule Them All!","archived":false,"fork":false,"pushed_at":"2022-02-10T17:19:49.000Z","size":569,"stargazers_count":60,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T16:08:52.381Z","etag":null,"topics":["computer-vision","deep-learning","machine-learning","metrics","object-detection"],"latest_commit_sha":null,"homepage":"https://skalskip.github.io/onemetric","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SkalskiP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-04T09:34:06.000Z","updated_at":"2025-04-03T14:44:55.000Z","dependencies_parsed_at":"2022-09-26T17:31:04.862Z","dependency_job_id":null,"html_url":"https://github.com/SkalskiP/onemetric","commit_stats":null,"previous_names":["skalskip/cv-metrics"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkalskiP%2Fonemetric","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkalskiP%2Fonemetric/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkalskiP%2Fonemetric/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkalskiP%2Fonemetric/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SkalskiP","download_url":"https://codeload.github.com/SkalskiP/onemetric/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886324,"owners_count":21177643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","deep-learning","machine-learning","metrics","object-detection"],"created_at":"2024-10-03T12:04:20.699Z","updated_at":"2026-03-01T22:38:07.966Z","avatar_url":"https://github.com/SkalskiP.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/onemetric.svg)](https://badge.fury.io/py/onemetric)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/onemetric)\n![PyPI - License](https://img.shields.io/pypi/l/onemetric)\n[![codecov](https://codecov.io/gh/SkalskiP/onemetric/branch/master/graph/badge.svg?token=ZFSEYF9WN4)](https://codecov.io/gh/SkalskiP/onemetric)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/onemetric)\n\n\u003ch1 align=\"center\"\u003eonemetric\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e \n    \u003cimg width=\"150\" src=\"https://onemetric-images.s3.eu-central-1.amazonaws.com/favicon.png\" alt=\"Logo\"\u003e\n\u003c/p\u003e\n\n## Installation\n\n* Install onemetric from PyPI (recommended):\n\n   ```console\n   pip install --upgrade pip\n   pip install onemetric\n   ```\n  \n* Install onemetric from the GitHub source:\n\n   ```console\n   git clone https://github.com/SkalskiP/onemetric.git\n   cd onemetric\n   python setup.py install\n   ```\n\n## Example\n\n\u003cp align=\"center\"\u003e \n    \u003cimg width=\"800\" src=\"https://onemetric-images.s3.eu-central-1.amazonaws.com/sample.png\" alt=\"dataset-sample\"\u003e\n\u003c/p\u003e\n\n**Figure 1.** Dataset sample, blue - ground-truth and red - detection.\n\n### Calculate mAP@0.5\n\n```python\n\u003e\u003e\u003e from onemetric.cv.loaders import YOLOLoader\n\u003e\u003e\u003e from onemetric.cv.object_detection import MeanAveragePrecision\n\n\u003e\u003e\u003e model = load_model(...)  # model-specific loading method\n\n\u003e\u003e\u003e data_set = YOLOLoader(\n...     images_dir_path=DATA_SET_IMAGES_PATH, \n...     annotations_dir_path=DATA_SET_ANNOTATIONS_PATH\n... ).load()\n\n\u003e\u003e\u003e true_batches, detection_batches = [], []\n\u003e\u003e\u003e for entry in data_set:\n\u003e\u003e\u003e     detections = model(entry.get_image())  # model-specific prediction method\n\u003e\u003e\u003e     true_batches.append(entry.get_annotations())\n\u003e\u003e\u003e     detection_batches.append(detections)\n\n\u003e\u003e\u003e mean_average_precision = MeanAveragePrecision.from_detections(\n...     true_batches=true_batches, \n...     detection_batches=detection_batches, \n...     num_classes=12,\n...     iou_threshold=0.5\n... )\n\n\u003e\u003e\u003e mean_average_precision.value\n0.61\n```\n\n### Calculate Confusion Matrix\n\n```python\n\n\n\u003e\u003e\u003e confusion_matrix = ConfusionMatrix.from_detections(\n...     true_batches=true_batches, \n...     detection_batches=detection_batches,\n...     num_classes=12\n... )\n\n\u003e\u003e\u003e confusion_matrix.plot(CONFUSION_MATRIX_TARGET_PATH, class_names=CLASS_NAMES)\n```\n\n\u003cp align=\"center\"\u003e \n    \u003cimg width=\"800\" src=\"https://onemetric-images.s3.eu-central-1.amazonaws.com/confusion_matrix.png\" alt=\"dataset-sample\"\u003e\n\u003c/p\u003e\n\n**Figure 2.** Create confusion matrix chart\n\n## Documentation\n\nThe official documentation is hosted on Github Pages: https://skalskip.github.io/onemetric\n\n## Contribute\n\nFeel 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!**\n\n## Citation\n\nPlease cite onemetric in your publications if this is useful for your research. Here is an example BibTeX entry:\n\n```BibTeX\n@MISC{onemetric,\n   author = {Piotr Skalski},\n   title = {{onemetric}},\n   howpublished = \"\\url{https://github.com/SkalskiP/onemetric/}\",\n   year = {2021},\n}\n```\n\n## License\n\nThis project is licensed under the BSD 3 - see the [LICENSE][1] file for details.\n\n\n[1]: https://github.com/SkalskiP/onemetric/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskalskip%2Fonemetric","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskalskip%2Fonemetric","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskalskip%2Fonemetric/lists"}