0.0.12 • Published 3 years ago

autoseg v0.0.12

Weekly downloads
1,031
License
LGPL
Repository
github
Last release
3 years ago

autoseg | Automatic Fast WebAssembly Image Segmentation

autoseg segments images from a list of points and polygons containing classifications. Autoseg was originally created by Severin Ibarluzea for usage with the Universal Data Tool.

Features

  • Simple API
  • WebWorker background computation
  • Deterministic, suitable for mask compression
  • Fast. WebAssembly compiled from state of the art C++ implementations of SLIC superpixeling and graph cut
  • Fully compliant with the Universal Data Tool and UDT Format

Example Inputs -> Output

Input Image

Input Image

Input Polygon

Input Image Polygon

Output Mask

Output Mask

API

const autoseg = require("autoseg") // OR require("autoseg/node")

await autoseg.loadImage({ data: imData, width: 320, height: 249 })

// Points/polygons are in the UDT Shape format
// https://github.com/UniversalDataTool/udt-format
const maskImageData = await autoseg.getMask([
  { regionType: "point", x: 50, y: 50, cls: 0 },
  { regionType: "point", x: 150, y: 150, cls: 1 },
])

// If you have a canvas, you can draw the image of the mask
canvasContext.putImageData(maskImageData, 0, 0)

// NOTE: nodejs doesn't have builtin support for ImageData, but you
// can use the returned data in a similar way, it's an object with
// { data: Uint8ClampedArray, width: number, height: number }

Configuring

await autoseg.setConfig({
  maxClusters: 1000,
  classNames: ["dog", "cat"],
  classColors: [0xffffffff, 0xff000000],
})
0.0.12

3 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago