Object Detection Metrics
Project description
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
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for object-detection-metrics-0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e4552a7a23017b42d7a6fc4e0b0e026c385ee9cbc946c36bc6c4c6bf9471a2f |
|
MD5 | 8dfd3f3c5939d31c5cc1bc77b9c39255 |
|
BLAKE2b-256 | a8f7a222eae3b4bb30eb8ef98f71ec3e79f5bda886327512c32d454aea3ad55d |
Close
Hashes for object_detection_metrics-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f49627e19cc5fb649a7b2006dcb0f1826702da87dd4d921a7423cc618c5b83c |
|
MD5 | 1d9d3f86e9680d82db8e891373623e09 |
|
BLAKE2b-256 | 52a0195efb39b77132494c5e69f3cc464b220911d639d05cc18326c625bb8a2f |