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.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e729f621c993609d7b721209cb3164c2e0bf8775e16c877971be116f13a9d5a |
|
MD5 | d786bbda61b30d7fa243222d5e2102b3 |
|
BLAKE2b-256 | 5c33ea7f654cbd89488912859705bb765fc8c3783b7086358cc25cad3a10b519 |
Close
Hashes for object_detection_metrics-0.3.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb9483af97c2f20bfbed2dc314b924b18b551508db568297d3fb1f7f9b1a572b |
|
MD5 | 058c3db6d349870f31cd4781c0ea036f |
|
BLAKE2b-256 | 75a91a60d8dc0d7543a371eb7902c9ec92376531e28c94102fe109f9d46ec506 |