0.2.4 • Published 6 months ago

@annotorious/plugin-segment-anything v0.2.4

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
6 months ago

Annotorious SegmentAnything Plugin

A fully browser-based smart polygon selection tool for Annotorious based on the sam2-hiera-tiny SegmentAnything model. The basic approach is inspired by this blog post and demo code.

Demo

Important: this plugin only supports @annotorious/openseadragon at this time. Support for plain (JPEG, PNG,...) images is not yet implemented. Get in touch via the forum if you are interested in using this with the @annotorious/annotorious or @annotorious/react packages.

Using with OpenSeadragon

npm install @annotorious/plugin-segment-anything
import OpenSeadragon from 'openseadragon';
import { createOSDAnnotator } from '@annotorious/openseadragon';
import { mountOpenSeadragonPlugin } from '@annotorious/plugin-segment-anything/openseadragon';

import '@annotorious/openseadragon/annotorious-openseadragon.css';

const viewer = OpenSeadragon({
  /** init your viewer **/
});

const anno = createOSDAnnotator(viewer, { /* options */ });

// Initialize the plugin
const plugin = mountOpenSeadragonPlugin(anno);

// This will start initializing the plugin, incl.
// download of the model (this may take a while).
plugin.init();

plugin.on('downloadStart', () => {
  console.log('downloading the model - this may take a while');
});

plugin.on('downloadProgress', progress => {
  if (progress.complete)
    console.log('downloading complete');
});

plugin.on('initialized', () => {
  console.log('plugin ready');
});

plugin.on('encodingStart', () => {
  console.log('busy - encoding viewport');
});

plugin.on('encodingFinished', () => {
  console.log('ready - click to create annotation!');
});
0.2.4

6 months ago

0.2.3

7 months ago

0.2.2

7 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.1.15

8 months ago

0.1.14

8 months ago

0.1.13

8 months ago

0.1.12

9 months ago

0.1.11

9 months ago

0.1.10

9 months ago

0.1.9

9 months ago

0.1.8

9 months ago

0.1.7

9 months ago

0.1.6

9 months ago

0.1.5

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago