{"id":20423998,"url":"https://github.com/emalagoli92/od-metrics","last_synced_at":"2025-10-16T07:29:46.443Z","repository":{"id":212970157,"uuid":"732726471","full_name":"EMalagoli92/OD-Metrics","owner":"EMalagoli92","description":"Python library for Object Detection metrics.","archived":false,"fork":false,"pushed_at":"2024-04-22T10:34:15.000Z","size":1172,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-22T11:43:38.401Z","etag":null,"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"],"latest_commit_sha":null,"homepage":"https://emalagoli92.github.io/OD-Metrics/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EMalagoli92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-17T16:28:28.000Z","updated_at":"2024-04-22T07:05:03.000Z","dependencies_parsed_at":"2023-12-22T13:00:31.949Z","dependency_job_id":"8e106b3a-4518-45fd-81ce-8878a92a258f","html_url":"https://github.com/EMalagoli92/OD-Metrics","commit_stats":null,"previous_names":["emalagoli92/od-metrics"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EMalagoli92%2FOD-Metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EMalagoli92%2FOD-Metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EMalagoli92%2FOD-Metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EMalagoli92%2FOD-Metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EMalagoli92","download_url":"https://codeload.github.com/EMalagoli92/OD-Metrics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248617112,"owners_count":21134190,"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":["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"],"created_at":"2024-11-15T07:08:25.231Z","updated_at":"2025-10-16T07:29:46.417Z","avatar_url":"https://github.com/EMalagoli92.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/EMalagoli92/OD-Metrics/main/docs/assets/images/logo_dark.svg\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/EMalagoli92/OD-Metrics/main/docs/assets/images/logo_light.svg\"\u003e\n  \u003cimg width=\"400\" height=\"400\" src=\"https://raw.githubusercontent.com/EMalagoli92/OD-Metrics/main/docs/assets/images/logo_light.svg\"\u003e\n\u003c/picture\u003e\n\u003c/div\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EMalagoli92/3f159a4246243b883a5c817ca2d34baa/raw/unit_test.json?kill_cache=1\" /\u003e\n  \u003cimg src=\"https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EMalagoli92/d23fd688b541d4b303d2baa6ee87e51a/raw/mypy.json?kill_cache=1\" /\u003e\n  \u003cimg src=\"https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EMalagoli92/3ab4a977b9a0e4ccb7178dd1fa51e1b0/raw/pylint.json?kill_cache=1\" /\u003e\n  \u003ca href=\"https://codecov.io/gh/EMalagoli92/OD-Metrics\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/EMalagoli92/OD-Metrics/graph/badge.svg?token=U7VJTKGYN6\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/od-metrics/#description\"\u003e\n    \u003cimg src=\"https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EMalagoli92/331395960725a4b47d4ca4977a24e949/raw/version.json?kill_cache=1\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-%3E=3.9-yellow.svg?style=flat\"\u003e\n  \u003ca href=\"https://github.com/EMalagoli92/OD-Metrics/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat\" alt=\"License: Apache 2.0\"\u003e\u003c/a\u003e\u003cbr\u003e\n  \u003ca href=\"https://mybinder.org/v2/gh/EMalagoli92/OD-metrics/HEAD?labpath=samples%2Fsamples.ipynb\"\u003e\n    \u003cimg src=\"https://mybinder.org/badge_logo.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://colab.research.google.com/github/EMalagoli92/OD-Metrics/blob/main/samples/samples.ipynb\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Open%20in%20Colab-blue?logo=google-colab\u0026style=flat\u0026labelColor=555\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003e\n    A python library for Object Detection metrics.\n  \u003c/strong\u003e\n\u003c/p\u003e\n\n\n## Why OD-Metrics?\n- **User-friendly**: Designed for simplicity, allowing users to calculate metrics with minimal setup.\n- **Highly Customizable**: Offers flexibility by allowing users to set custom values for every parameter in metrics definitions.\n- **COCOAPI Compatibility**: Metrics are rigorously tested to ensure compatibility with [COCOAPI](https://github.com/cocodataset/cocoapi), ensuring reliability and consistency.\n\n\n## Supported Metrics\nSupported metrics include:\n\n- [mAP](https://emalagoli92.github.io/OD-Metrics/map_mar/) (Mean Average Precision)\n- [mAR](https://emalagoli92.github.io/OD-Metrics/map_mar/#average-recall) (Mean Average Recall)\n- [IoU](https://emalagoli92.github.io/OD-Metrics/iou/) (Intersection over Union).\n\nFor more information see [Metrics](https://emalagoli92.github.io/OD-Metrics/iou/) documentation.\n\n## Documentation\nFor help, usage, API reference, and an overview of metrics formulas, please refer to [Documentation](https://emalagoli92.github.io/OD-Metrics/).\n\n\n## Try live Demo\nTry `OD-Metrics` samples [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/EMalagoli92/OD-metrics/HEAD?labpath=samples%2Fsamples.ipynb)\n  \u003ca href=\"https://colab.research.google.com/github/EMalagoli92/OD-Metrics/blob/main/samples/samples.ipynb\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Open%20in%20Colab-blue?logo=google-colab\u0026style=flat\u0026labelColor=555\"\u003e\u003c/a\u003e\n\n\n## Installation\nInstall from PyPI\n```\npip install od-metrics\n```\nInstall from Github\n```\npip install git+https://github.com/EMalagoli92/OD-Metrics\n```\n\n\n## Simple Example\n\n``` python\nfrom od_metrics import ODMetrics\n\n# Ground truths\ny_true = [\n    { # image 1\n     \"boxes\": [[25, 16, 38, 56], [129, 123, 41, 62]],\n     \"labels\": [0, 1]\n     },\n    { # image 2\n     \"boxes\": [[123, 11, 43, 55], [38, 132, 59, 45]],\n     \"labels\": [0, 0]\n     }\n    ]\n\n# Predictions\ny_pred = [\n    { # image 1\n     \"boxes\": [[25, 27, 37, 54], [119, 111, 40, 67], [124, 9, 49, 67]],\n     \"labels\": [0, 1, 1],\n     \"scores\": [.88, .70, .80]\n     },\n    { # image 2\n     \"boxes\": [[64, 111, 64, 58], [26, 140, 60, 47], [19, 18, 43, 35]],\n     \"labels\": [0, 1, 0],\n     \"scores\": [.71, .54, .74]\n     }\n    ]\n\nmetrics = ODMetrics()\noutput = metrics.compute(y_true, y_pred)\nprint(output)\n\"\"\"\n{\n    \"mAP@[.5 | all | 100]\": 0.16831683168316827,\n    \"mAP@[.5:.95 | all | 100]\": 0.06732673267326732,\n    \"mAP@[.5:.95 | large | 100]\": -1.0,\n    \"mAP@[.5:.95 | medium | 100]\": 0.06732673267326732,\n    \"mAP@[.5:.95 | small | 100]\": -1.0,\n    \"mAP@[.75 | all | 100]\": 0.0,\n    \"mAR@[.5 | all | 100]\": 0.16666666666666666,\n    \"mAR@[.5:.95 | all | 100]\": 0.06666666666666667,\n    \"mAR@[.5:.95 | all | 10]\": 0.06666666666666667,\n    \"mAR@[.5:.95 | all | 1]\": 0.06666666666666667,\n    \"mAR@[.5:.95 | large | 100]\": -1.0,\n    \"mAR@[.5:.95 | medium | 100]\": 0.06666666666666667,\n    \"mAR@[.5:.95 | small | 100]\": -1.0,\n    \"mAR@[.75 | all | 100]\": 0.0,\n    \"class_metrics\": {\n        \"0\": {\n            \"AP@[.5 | all | 100]\": 0.33663366336633654,\n            \"AP@[.5:.95 | all | 100]\": 0.13465346534653463,\n            \"AP@[.5:.95 | large | 100]\": -1.0,\n            \"AP@[.5:.95 | medium | 100]\": 0.13465346534653463,\n            \"AP@[.5:.95 | small | 100]\": -1.0,\n            \"AP@[.75 | all | 100]\": 0.0,\n            \"AR@[.5 | all | 100]\": 0.3333333333333333,\n            \"AR@[.5:.95 | all | 100]\": 0.13333333333333333,\n            \"AR@[.5:.95 | all | 10]\": 0.13333333333333333,\n            \"AR@[.5:.95 | all | 1]\": 0.13333333333333333,\n            \"AR@[.5:.95 | large | 100]\": -1.0,\n            \"AR@[.5:.95 | medium | 100]\": 0.13333333333333333,\n            \"AR@[.5:.95 | small | 100]\": -1.0,\n            \"AR@[.75 | all | 100]\": 0.0\n        },\n        \"1\": {\n            \"AP@[.5 | all | 100]\": 0.0,\n            \"AP@[.5:.95 | all | 100]\": 0.0,\n            \"AP@[.5:.95 | large | 100]\": -1.0,\n            \"AP@[.5:.95 | medium | 100]\": 0.0,\n            \"AP@[.5:.95 | small | 100]\": -1.0,\n            \"AP@[.75 | all | 100]\": 0.0,\n            \"AR@[.5 | all | 100]\": 0.0,\n            \"AR@[.5:.95 | all | 100]\": 0.0,\n            \"AR@[.5:.95 | all | 10]\": 0.0,\n            \"AR@[.5:.95 | all | 1]\": 0.0,\n            \"AR@[.5:.95 | large | 100]\": -1.0,\n            \"AR@[.5:.95 | medium | 100]\": 0.0,\n            \"AR@[.5:.95 | small | 100]\": -1.0,\n            \"AR@[.75 | all | 100]\": 0.0\n        }\n    },\n    \"classes\": [\n        0,\n        1\n    ],\n    \"n_images\": 2\n}\n\"\"\"\n```\n\n\n## Aknowledgment\n- [TorchMetrics](https://github.com/Lightning-AI/torchmetrics)\n- [COCO API](https://github.com/cocodataset/cocoapi)\n- [Object-Detection-Metrics](https://github.com/rafaelpadilla/Object-Detection-Metrics)\n\n## License\nThis work is made available under the [Apache License 2.0](https://github.com/EMalagoli92/OD-Metrics/blob/main/LICENSE)\n\n## Support\nFound this helpful? ⭐ it on [GitHub](https://github.com/EMalagoli92/OD-Metrics)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femalagoli92%2Fod-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femalagoli92%2Fod-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femalagoli92%2Fod-metrics/lists"}