Skip to main content

A simple tool for calculating object detection map

Project description

np-map

A simple tool for calculating object detection map .

Usage:

from npmap import ConfusionMatrix
matrix = ConfusionMatrix(num_classes=80) # coco 80 classes

# cleanup first
matrix.clean()

for (pred, gt) in (preds, gts): # for loop for every images
    # pred format x0, y0, x1, y1, scores, labels
    # gt format x0, y0, x1, y1, labels
    # if there is no gt or pred, please set pred=None or gt=None
    matrix.add(pred, gt)

# calculate map, map50, etc.
res = matrix.calculate()

# print map
print(res['map'])

# print map50
print(res['map50'])

# print mar
print(res['mean_recall'])

# print mp
print(res['mean_precision'])

... # so on

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

npmap-0.0.0-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

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