@annotorious/plugin-segment-anything 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,10 +68,14 @@ interface SAM2WorkerEncodeError {
68
68
  error: any;
69
69
  viewportVersion?: number;
70
70
  }
71
+ interface SAM2WorkerDecodePreviewError {
72
+ type: 'decode_preview_error';
73
+ error: any;
74
+ }
71
75
  interface SAM2WorkerDecodeError {
72
76
  type: 'decode_error';
73
77
  error: any;
74
78
  }
75
- export type SAM2WorkerError = SAM2WorkerInitError | SAM2WorkerEncodeError | SAM2WorkerDecodeError;
79
+ export type SAM2WorkerError = SAM2WorkerInitError | SAM2WorkerEncodeError | SAM2WorkerDecodePreviewError | SAM2WorkerDecodeError;
76
80
  export type SAM2WorkerResult = SAM2WorkerSuccess | SAM2WorkerError;
77
81
  export {};
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ImageAnnotation } from '@annotorious/annotorious';
1
2
  import { InferenceSession, Tensor } from 'onnxruntime-web/all';
2
3
  export interface SAMPluginOpts {
3
4
  maxPreviewCoverage?: number;
@@ -5,10 +6,13 @@ export interface SAMPluginOpts {
5
6
  export interface SAMPluginEvents {
6
7
  animationFinished: () => void;
7
8
  animationStart: () => void;
9
+ createAnnotation: (annotation: ImageAnnotation, prompt: SAM2DecoderPrompt) => void;
10
+ deleteAnnotation: (annotation: ImageAnnotation) => void;
8
11
  encodingFinished: () => void;
9
12
  encodingStart: () => void;
10
13
  initialized: () => void;
11
- promptChanged: (prompt?: SAM2DecoderPrompt) => void;
14
+ initError: (error: any) => void;
15
+ updateAnnotation: (annotation: ImageAnnotation, previous: ImageAnnotation, prompt: SAM2DecoderPrompt) => void;
12
16
  }
13
17
  export interface Point {
14
18
  x: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annotorious/plugin-segment-anything",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "A smart polygon selection tool based on SegmentAnything 2",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",