Skip to main content

Object Detection metrics.

Project description

License: MIT

A metrics package for Object Detection.

Supported Metrics

Supported metrics include mAP (Mean Average Precision), mAR (Mean Average Recall) and Intersection over Union IoU.

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: each calculated metric is tested to coincide with COCOAPI metrics.

Installation

Install from PyPI

pip install od-metrics

Install from Github

pip install git+https://github.com/EMalagoli92/OD-Metrics

Documentation

For help, usage and API reference, please refer to Documentation

Simple Example

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

License

This work is made available under the MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

od-metrics-0.0.12.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

od_metrics-0.0.12-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file od-metrics-0.0.12.tar.gz.

File metadata

  • Download URL: od-metrics-0.0.12.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for od-metrics-0.0.12.tar.gz
Algorithm Hash digest
SHA256 8e55ffaa5b7d22b399737ace37a5c719c1b7f4cb1e25aafbf04f0c398fd6871a
MD5 9793070e8823c4aff6b0a91b70aa13ec
BLAKE2b-256 49381f8a90a1fd6b0c695acdc6ec8430f1422907faa1a208cdacd06dd29f4860

See more details on using hashes here.

File details

Details for the file od_metrics-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: od_metrics-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for od_metrics-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 fa9309a7799b8547158877246e3294f5dfeae1a38bbab8d452cdd485fd7b7a92
MD5 f813b49da6113a595c6633b9bd6a4bc8
BLAKE2b-256 c89f21c033a682503fef422f33981496b88733d37f0ca146704c8296c32384b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page