0.2.2 • Published 5 years ago

udt-iou-error v0.2.2

Weekly downloads
60
License
-
Repository
-
Last release
5 years ago

UDT IOU Error

Compute the intersection over union error of groups of polygons (UDT regions). Created primarily for use with the Universal Data Tool.

All x/y coordinates should be in a 1x1 area, anything outside of the 1x1 area won't be considered. (If you want to change this behavior to something more configurable, PRs are welcome!)

// install with npm install udt-iou-error
const getIOU = require("udt-iou-error")

const annotation1 = [
  {
    regionType: "bounding-box",
    centerX: 0.5,
    centerY: 0.5,
    width: 0.5,
    height: 0.5,
  },
]

const annotation2 = [
  {
    regionType: "polygon",
    points: [
      { x: 0, y: 0 },
      { x: 0, y: 1 },
      { x: 1, y: 1 },
    ],
  },
]

getIOU(annotation1, annotation2)
// >> 0.2

Classifications

It's also smart enough to calculate IOU error with multiple classifications.

const getIOU = require("udt-iou-error")

const annotation1 = [
  {
    regionType: "bounding-box",
    classification: "red",
    centerX: 0.5,
    centerY: 0.5,
    width: 0.5,
    height: 0.5,
  },
  {
    regionType: "bounding-box",
    classification: "blue",
    centerX: 0.1,
    centerY: 0.1,
    width: 0.2,
    height: 0.2,
  },
]

const annotation2 = [
  {
    regionType: "polygon",
    classification: "blue",
    points: [
      { x: 0, y: 0 },
      { x: 0, y: 1 },
      { x: 1, y: 1 },
    ],
  },
]

getIOU(annotation1, annotation2)
// >> 0.259
0.2.1

5 years ago

0.2.2

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.0

5 years ago

0.0.1-beta.1

5 years ago

0.0.1

5 years ago