Skip to main content

Object Detection Metrics

Project description

Build status Latest version on PyPI License Downloads Pythong version codecov Hits

This project was forked from rafaelpadilla/Object-Detection-Metrics.

Getting started

Installing object_detection_metrics

$ pip install object_detection_metrics

Reading Josn file

import podm
bounding_boxes = podm.load_data('tests/sample_2/groundtruths.json')

Reading COCO file

import podm
bounding_boxes = podm.load_data_coco('tests/sample_2/groundtruths_coco.json')

PASCAL VOC Metrics

import podm
gt_BoundingBoxes = podm.load_data('tests/sample_2/groundtruths.json')
pd_BoundingBoxes = podm.load_data('tests/sample_2/detections.json')
results = podm.get_pascal_voc_metrics(gt_BoundingBoxes, pd_BoundingBoxes, .5)

ap, precision, recall, tp, fp, etc

for cls, metric in actuals.items():
    label = m.label
    print('ap', metric.ap)
    print('precision', metric.precision)
    print('interpolated_recall', metric.interpolated_recall)
    print('interpolated_precision', metric.interpolated_precision)
    print('tp', metric.tp)
    print('fp', metric.fp)
    print('num_groundtruth', metric.num_groundtruth)
    print('num_detection', metric.num_detection)

mAP

from podm import MetricPerClass
mAP = MetricPerClass.mAP(results)

IoU

box1 = Box(0., 0., 10., 10.)
box2 = Box(1., 1., 11., 11.)
Box.intersection_over_union(box1, box2)

Implemented metrics

Tutorial

  • Intersection Over Union (IOU)
  • TP and FP
    • True Positive (TP): IOU ≥ IOU threshold (default: 0.5)
    • False Positive (FP): IOU < IOU threshold (default: 0.5)
  • Precision and Recall
  • Average Precision
    • 11-point AP
    • all-point AP

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

object-detection-metrics-0.3.post1.tar.gz (10.6 kB view hashes)

Uploaded Source

Built Distribution

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