supervision 0.0.9000 → 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +23 -2
- package/dist/constants/media-renderer.d.ts +9 -0
- package/dist/constants/media-renderer.d.ts.map +1 -0
- package/dist/detections/browser-cold-detection-frame-store.d.ts +5 -0
- package/dist/detections/browser-cold-detection-frame-store.d.ts.map +1 -0
- package/dist/detections/chunked-detection-frame-source.d.ts +3 -0
- package/dist/detections/chunked-detection-frame-source.d.ts.map +1 -0
- package/dist/detections/offset-detection-frame-source.d.ts +10 -0
- package/dist/detections/offset-detection-frame-source.d.ts.map +1 -0
- package/dist/editing/mask-brush-editor.d.ts +47 -0
- package/dist/editing/mask-brush-editor.d.ts.map +1 -0
- package/dist/editing.d.ts +8 -0
- package/dist/editing.d.ts.map +1 -0
- package/dist/editing.js +265 -0
- package/dist/editing.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9419 -0
- package/dist/index.js.map +1 -0
- package/dist/mask-preparation.worker.js +823 -0
- package/dist/mask-preparation.worker.js.map +1 -0
- package/dist/media/decoded-video-sample-reader.d.ts +8 -0
- package/dist/media/decoded-video-sample-reader.d.ts.map +1 -0
- package/dist/media/media-metadata.d.ts +21 -0
- package/dist/media/media-metadata.d.ts.map +1 -0
- package/dist/media/media-normalization.d.ts +6 -0
- package/dist/media/media-normalization.d.ts.map +1 -0
- package/dist/media/media-preparation.d.ts +9 -0
- package/dist/media/media-preparation.d.ts.map +1 -0
- package/dist/media/media-probe.d.ts +3 -0
- package/dist/media/media-probe.d.ts.map +1 -0
- package/dist/media/media-source-state.d.ts +5 -0
- package/dist/media/media-source-state.d.ts.map +1 -0
- package/dist/media/media-source.d.ts +38 -0
- package/dist/media/media-source.d.ts.map +1 -0
- package/dist/media/media-stream-media-source.d.ts +27 -0
- package/dist/media/media-stream-media-source.d.ts.map +1 -0
- package/dist/media/mediabunny-media-source.d.ts +13 -0
- package/dist/media/mediabunny-media-source.d.ts.map +1 -0
- package/dist/media/static-image-media-source.d.ts +13 -0
- package/dist/media/static-image-media-source.d.ts.map +1 -0
- package/dist/playback/media-playback-controller.d.ts +24 -0
- package/dist/playback/media-playback-controller.d.ts.map +1 -0
- package/dist/render-preparation/default-render-preparation-worker.d.ts +8 -0
- package/dist/render-preparation/default-render-preparation-worker.d.ts.map +1 -0
- package/dist/render-preparation/embedded-mask-preparation-worker.d.ts +2 -0
- package/dist/render-preparation/embedded-mask-preparation-worker.d.ts.map +1 -0
- package/dist/render-preparation/mask-frame-artifact.d.ts +28 -0
- package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -0
- package/dist/render-preparation/mask-frame-compositor.d.ts +14 -0
- package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -0
- package/dist/render-preparation/mask-frame-preparer.d.ts +19 -0
- package/dist/render-preparation/mask-frame-preparer.d.ts.map +1 -0
- package/dist/render-preparation/mask-preparation-worker-count.d.ts +15 -0
- package/dist/render-preparation/mask-preparation-worker-count.d.ts.map +1 -0
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +64 -0
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -0
- package/dist/render-preparation/mask-preparation.worker.d.ts +2 -0
- package/dist/render-preparation/mask-preparation.worker.d.ts.map +1 -0
- package/dist/render-preparation/prepared-render-window.d.ts +46 -0
- package/dist/render-preparation/prepared-render-window.d.ts.map +1 -0
- package/dist/render-preparation/prepared-window-timeline.d.ts +16 -0
- package/dist/render-preparation/prepared-window-timeline.d.ts.map +1 -0
- package/dist/renderers/media-renderer-core.d.ts +9 -0
- package/dist/renderers/media-renderer-core.d.ts.map +1 -0
- package/dist/renderers/media-renderer-scene.d.ts +77 -0
- package/dist/renderers/media-renderer-scene.d.ts.map +1 -0
- package/dist/renderers/media-renderer-state.d.ts +44 -0
- package/dist/renderers/media-renderer-state.d.ts.map +1 -0
- package/dist/renderers/media-renderer.d.ts +8 -0
- package/dist/renderers/media-renderer.d.ts.map +1 -0
- package/dist/renderers/pixi-annotation-overlay-layer.d.ts +25 -0
- package/dist/renderers/pixi-annotation-overlay-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-box-layer.d.ts +28 -0
- package/dist/renderers/pixi-box-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-focus-layer.d.ts +92 -0
- package/dist/renderers/pixi-focus-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-id-mask-shader.d.ts +62 -0
- package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -0
- package/dist/renderers/pixi-interaction-layer.d.ts +63 -0
- package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts +84 -0
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-label-layer.d.ts +32 -0
- package/dist/renderers/pixi-label-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-mask-brush-preview.d.ts +26 -0
- package/dist/renderers/pixi-mask-brush-preview.d.ts.map +1 -0
- package/dist/renderers/pixi-mask-layer.d.ts +98 -0
- package/dist/renderers/pixi-mask-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-media-scene.d.ts +6 -0
- package/dist/renderers/pixi-media-scene.d.ts.map +1 -0
- package/dist/renderers/pixi-path.d.ts +15 -0
- package/dist/renderers/pixi-path.d.ts.map +1 -0
- package/dist/renderers/pixi-polygon-layer.d.ts +32 -0
- package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-scene-fit.d.ts +14 -0
- package/dist/renderers/pixi-scene-fit.d.ts.map +1 -0
- package/dist/renderers/pixi-scene-layer-slot.d.ts +23 -0
- package/dist/renderers/pixi-scene-layer-slot.d.ts.map +1 -0
- package/dist/renderers/pixi-vector-layer.d.ts +24 -0
- package/dist/renderers/pixi-vector-layer.d.ts.map +1 -0
- package/dist/sessions/media-session-defaults.d.ts +21 -0
- package/dist/sessions/media-session-defaults.d.ts.map +1 -0
- package/dist/sessions/media-session-detections.d.ts +16 -0
- package/dist/sessions/media-session-detections.d.ts.map +1 -0
- package/dist/sessions/media-session-media.d.ts +19 -0
- package/dist/sessions/media-session-media.d.ts.map +1 -0
- package/dist/sessions/media-session-state.d.ts +12 -0
- package/dist/sessions/media-session-state.d.ts.map +1 -0
- package/dist/sessions/media-session.d.ts +10 -0
- package/dist/sessions/media-session.d.ts.map +1 -0
- package/dist/types/media-normalization.d.ts +119 -0
- package/dist/types/media-normalization.d.ts.map +1 -0
- package/dist/types/media-preparation.d.ts +30 -0
- package/dist/types/media-preparation.d.ts.map +1 -0
- package/dist/types/media-renderer.d.ts +115 -0
- package/dist/types/media-renderer.d.ts.map +1 -0
- package/dist/types/media-session.d.ts +242 -0
- package/dist/types/media-session.d.ts.map +1 -0
- package/dist/types/render-preparation.d.ts +164 -0
- package/dist/types/render-preparation.d.ts.map +1 -0
- package/dist/workers/worker-rpc-client.d.ts +15 -0
- package/dist/workers/worker-rpc-client.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/detections/array-detection-frame-source.d.ts +4 -0
- package/node_modules/supervision-js-core/dist/detections/array-detection-frame-source.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts +14 -0
- package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/detections/cold-detection-frame-source.d.ts +6 -0
- package/node_modules/supervision-js-core/dist/detections/cold-detection-frame-source.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/detections/composite-detection-frame-source.d.ts +3 -0
- package/node_modules/supervision-js-core/dist/detections/composite-detection-frame-source.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/detections/editable-annotation-frame-session.d.ts +35 -0
- package/node_modules/supervision-js-core/dist/detections/editable-annotation-frame-session.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/detections/memory-cold-detection-frame-store.d.ts +3 -0
- package/node_modules/supervision-js-core/dist/detections/memory-cold-detection-frame-store.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/detections/writable-detection-frame-source.d.ts +8 -0
- package/node_modules/supervision-js-core/dist/detections/writable-detection-frame-source.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/index.d.ts +65 -0
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/index.js +4277 -0
- package/node_modules/supervision-js-core/dist/index.js.map +1 -0
- package/node_modules/supervision-js-core/dist/interactions/annotation-editing-engine.d.ts +3 -0
- package/node_modules/supervision-js-core/dist/interactions/annotation-editing-engine.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/interactions/annotation-handles.d.ts +13 -0
- package/node_modules/supervision-js-core/dist/interactions/annotation-handles.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts +7 -0
- package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/interactions/viewport-controller.d.ts +6 -0
- package/node_modules/supervision-js-core/dist/interactions/viewport-controller.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/box-style.d.ts +44 -0
- package/node_modules/supervision-js-core/dist/styles/box-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts +20 -0
- package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/focus-style.d.ts +37 -0
- package/node_modules/supervision-js-core/dist/styles/focus-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts +64 -0
- package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/keypoint-style.d.ts +19 -0
- package/node_modules/supervision-js-core/dist/styles/keypoint-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/label-style.d.ts +61 -0
- package/node_modules/supervision-js-core/dist/styles/label-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/mask-style.d.ts +55 -0
- package/node_modules/supervision-js-core/dist/styles/mask-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/polygon-style.d.ts +15 -0
- package/node_modules/supervision-js-core/dist/styles/polygon-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts +14 -0
- package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts +22 -0
- package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/style-value.d.ts +4 -0
- package/node_modules/supervision-js-core/dist/styles/style-value.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/box-style.d.ts +58 -0
- package/node_modules/supervision-js-core/dist/types/box-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts +325 -0
- package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/detections.d.ts +183 -0
- package/node_modules/supervision-js-core/dist/types/detections.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/editing.d.ts +140 -0
- package/node_modules/supervision-js-core/dist/types/editing.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/focus-style.d.ts +36 -0
- package/node_modules/supervision-js-core/dist/types/focus-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/interaction-style.d.ts +44 -0
- package/node_modules/supervision-js-core/dist/types/interaction-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/interaction.d.ts +70 -0
- package/node_modules/supervision-js-core/dist/types/interaction.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/keypoint-style.d.ts +30 -0
- package/node_modules/supervision-js-core/dist/types/keypoint-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/label-style.d.ts +65 -0
- package/node_modules/supervision-js-core/dist/types/label-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/mask-style.d.ts +59 -0
- package/node_modules/supervision-js-core/dist/types/mask-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +204 -0
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/media.d.ts +42 -0
- package/node_modules/supervision-js-core/dist/types/media.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/polygon-style.d.ts +13 -0
- package/node_modules/supervision-js-core/dist/types/polygon-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts +12 -0
- package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts +106 -0
- package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/style.d.ts +28 -0
- package/node_modules/supervision-js-core/dist/types/style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/viewport.d.ts +19 -0
- package/node_modules/supervision-js-core/dist/types/viewport.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/annotation-visibility.d.ts +5 -0
- package/node_modules/supervision-js-core/dist/utils/annotation-visibility.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/color-palette.d.ts +12 -0
- package/node_modules/supervision-js-core/dist/utils/color-palette.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/color.d.ts +4 -0
- package/node_modules/supervision-js-core/dist/utils/color.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/detection-conversions.d.ts +24 -0
- package/node_modules/supervision-js-core/dist/utils/detection-conversions.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts +16 -0
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts +31 -0
- package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/geometry.d.ts +11 -0
- package/node_modules/supervision-js-core/dist/utils/geometry.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +18 -0
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/mask-style.d.ts +4 -0
- package/node_modules/supervision-js-core/dist/utils/mask-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/object.d.ts +2 -0
- package/node_modules/supervision-js-core/dist/utils/object.d.ts.map +1 -0
- package/node_modules/supervision-js-core/package.json +51 -0
- package/package.json +92 -16
- package/index.js +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Axis-aligned rectangle in media pixel coordinates.
|
|
3
|
+
*
|
|
4
|
+
* This is semantic detection geometry, not a renderer shape. Presentation
|
|
5
|
+
* details such as stroke, fill, corner radius, or opacity belong to box styles.
|
|
6
|
+
* `x` and `y` identify the rectangle center.
|
|
7
|
+
*/
|
|
8
|
+
export interface Rect {
|
|
9
|
+
/**
|
|
10
|
+
* Center X coordinate in media pixels.
|
|
11
|
+
*/
|
|
12
|
+
readonly x: number;
|
|
13
|
+
/**
|
|
14
|
+
* Center Y coordinate in media pixels.
|
|
15
|
+
*/
|
|
16
|
+
readonly y: number;
|
|
17
|
+
/**
|
|
18
|
+
* Width in media pixels. Must be greater than 0.
|
|
19
|
+
*/
|
|
20
|
+
readonly width: number;
|
|
21
|
+
/**
|
|
22
|
+
* Height in media pixels. Must be greater than 0.
|
|
23
|
+
*/
|
|
24
|
+
readonly height: number;
|
|
25
|
+
}
|
|
26
|
+
/** A media-space point in pixels. */
|
|
27
|
+
export interface Point {
|
|
28
|
+
readonly x: number;
|
|
29
|
+
readonly y: number;
|
|
30
|
+
}
|
|
31
|
+
/** Explicit top-left rectangle for renderer and canvas layout boundaries. */
|
|
32
|
+
export interface TopLeftRect {
|
|
33
|
+
readonly x: number;
|
|
34
|
+
readonly y: number;
|
|
35
|
+
readonly width: number;
|
|
36
|
+
readonly height: number;
|
|
37
|
+
}
|
|
38
|
+
export interface PolygonGeometry {
|
|
39
|
+
readonly points: readonly Point[];
|
|
40
|
+
}
|
|
41
|
+
export interface PolylineGeometry {
|
|
42
|
+
readonly points: readonly Point[];
|
|
43
|
+
}
|
|
44
|
+
/** COCO-compatible keypoint visibility values. */
|
|
45
|
+
export declare enum KeypointVisibility {
|
|
46
|
+
NotLabeled = 0,
|
|
47
|
+
Occluded = 1,
|
|
48
|
+
Visible = 2
|
|
49
|
+
}
|
|
50
|
+
export type KeypointEdge = readonly [fromIndex: number, toIndex: number];
|
|
51
|
+
export interface KeypointGeometry {
|
|
52
|
+
readonly points: readonly Point[];
|
|
53
|
+
readonly edges: readonly KeypointEdge[];
|
|
54
|
+
readonly visibility?: readonly KeypointVisibility[];
|
|
55
|
+
}
|
|
56
|
+
export interface SkeletonVertexDefinition {
|
|
57
|
+
readonly id: number;
|
|
58
|
+
readonly name: string;
|
|
59
|
+
readonly color?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface SkeletonEdgeDefinition {
|
|
62
|
+
readonly from: number;
|
|
63
|
+
readonly to: number;
|
|
64
|
+
readonly color?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface SkeletonDefinition {
|
|
67
|
+
readonly vertices: readonly SkeletonVertexDefinition[];
|
|
68
|
+
readonly edges: readonly SkeletonEdgeDefinition[];
|
|
69
|
+
}
|
|
70
|
+
export type SkeletonDefinitions = Readonly<Record<string, SkeletonDefinition>>;
|
|
71
|
+
export declare enum DetectionMaskEncoding {
|
|
72
|
+
CompressedRle = "compressedRle"
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Compressed run-length encoded binary mask.
|
|
76
|
+
*
|
|
77
|
+
* RLE is the semantic cold-storage representation. Renderers may convert it
|
|
78
|
+
* into prepared runtime artifacts such as ID masks, textures, or other backend
|
|
79
|
+
* specific resources.
|
|
80
|
+
*/
|
|
81
|
+
export interface CompressedRleDetectionMask {
|
|
82
|
+
readonly encoding: DetectionMaskEncoding.CompressedRle;
|
|
83
|
+
/**
|
|
84
|
+
* Mask width in mask pixels.
|
|
85
|
+
*/
|
|
86
|
+
readonly width: number;
|
|
87
|
+
/**
|
|
88
|
+
* Mask height in mask pixels.
|
|
89
|
+
*/
|
|
90
|
+
readonly height: number;
|
|
91
|
+
/**
|
|
92
|
+
* Compressed RLE counts string.
|
|
93
|
+
*
|
|
94
|
+
* This matches the compact binary-mask representation commonly emitted by CV
|
|
95
|
+
* tooling. The renderer may prepare it into an ID-mask artifact before drawing.
|
|
96
|
+
*/
|
|
97
|
+
readonly counts: string;
|
|
98
|
+
}
|
|
99
|
+
export type DetectionMask = CompressedRleDetectionMask;
|
|
100
|
+
/**
|
|
101
|
+
* One model output for a media frame.
|
|
102
|
+
*
|
|
103
|
+
* A detection stores model data only: identity, class, confidence, geometry,
|
|
104
|
+
* mask, and caller metadata. It intentionally does not carry render styling.
|
|
105
|
+
* Styling is resolved through presentation styles so the same detections can be
|
|
106
|
+
* rendered as boxes, masks, labels, or future layers without mutating the
|
|
107
|
+
* underlying annotation data.
|
|
108
|
+
*/
|
|
109
|
+
export interface Detection {
|
|
110
|
+
/**
|
|
111
|
+
* Optional stable identity for picking, interaction, and host app metadata.
|
|
112
|
+
*/
|
|
113
|
+
readonly id?: string | number;
|
|
114
|
+
/**
|
|
115
|
+
* Optional provenance for detections copied from a composed source.
|
|
116
|
+
*
|
|
117
|
+
* This is renderer-neutral source identity, not product workflow state.
|
|
118
|
+
*/
|
|
119
|
+
readonly sourceId?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Optional source-local detection index before composition.
|
|
122
|
+
*/
|
|
123
|
+
readonly sourceDetectionIndex?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Optional semantic class name, such as `person`, `vehicle`, or `basketball`.
|
|
126
|
+
*/
|
|
127
|
+
readonly className?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Optional confidence score from 0 to 1.
|
|
130
|
+
*/
|
|
131
|
+
readonly confidence?: number;
|
|
132
|
+
/** Optional host-owned annotation attributes. */
|
|
133
|
+
readonly attributes?: readonly string[];
|
|
134
|
+
/** Optional per-annotation render and pick order. Higher values are on top. */
|
|
135
|
+
readonly zIndex?: number;
|
|
136
|
+
/** Optional host editing lock. Renderers may still present locked records. */
|
|
137
|
+
readonly locked?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Optional axis-aligned media-pixel rectangle.
|
|
140
|
+
*/
|
|
141
|
+
readonly rect?: Rect;
|
|
142
|
+
/** Optional closed polygon in media-pixel coordinates. */
|
|
143
|
+
readonly polygon?: PolygonGeometry;
|
|
144
|
+
/** Optional open path in media-pixel coordinates. */
|
|
145
|
+
readonly polyline?: PolylineGeometry;
|
|
146
|
+
/** Optional keypoints and skeleton edges in media-pixel coordinates. */
|
|
147
|
+
readonly keypoints?: KeypointGeometry;
|
|
148
|
+
/**
|
|
149
|
+
* Optional binary mask in semantic cold-storage form.
|
|
150
|
+
*/
|
|
151
|
+
readonly mask?: DetectionMask;
|
|
152
|
+
/**
|
|
153
|
+
* Caller-owned metadata. The renderer does not interpret this field.
|
|
154
|
+
*/
|
|
155
|
+
readonly metadata?: Record<string, unknown>;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Detections associated with one media time.
|
|
159
|
+
*
|
|
160
|
+
* `mediaTime` is seconds on the renderer media timeline. `endTime`, when
|
|
161
|
+
* provided, is exclusive. `frameIndex` can be used when detections are produced
|
|
162
|
+
* on a known inference frame grid and the session is configured for nearest
|
|
163
|
+
* frame-index selection.
|
|
164
|
+
*/
|
|
165
|
+
export interface DetectionFrame {
|
|
166
|
+
/**
|
|
167
|
+
* Optional inference frame index for frame-grid synchronized detections.
|
|
168
|
+
*/
|
|
169
|
+
readonly frameIndex?: number;
|
|
170
|
+
/**
|
|
171
|
+
* Media timeline time in seconds.
|
|
172
|
+
*/
|
|
173
|
+
readonly mediaTime: number;
|
|
174
|
+
/**
|
|
175
|
+
* Exclusive end time in seconds. Omit for point-in-time frames.
|
|
176
|
+
*/
|
|
177
|
+
readonly endTime?: number;
|
|
178
|
+
/**
|
|
179
|
+
* Detections active for this frame interval.
|
|
180
|
+
*/
|
|
181
|
+
readonly detections: readonly Detection[];
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=detections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detections.d.ts","sourceRoot":"","sources":["../../src/types/detections.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,qCAAqC;AACrC,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM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AAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAC3C"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { Detection, Point, Rect } from "#types/detections";
|
|
2
|
+
import type { DetectionPickResult } from "#types/interaction";
|
|
3
|
+
import type { BoxFillStyle, BoxStrokeStyle } from "#types/box-style";
|
|
4
|
+
import type { AnnotationStyleContext, DetectionStyleValue } from "#types/style";
|
|
5
|
+
export declare enum AnnotationGeometryKind {
|
|
6
|
+
Box = "box",
|
|
7
|
+
Polygon = "polygon",
|
|
8
|
+
Polyline = "polyline",
|
|
9
|
+
Keypoints = "keypoints",
|
|
10
|
+
Mask = "mask"
|
|
11
|
+
}
|
|
12
|
+
export declare enum AnnotationGestureStateKind {
|
|
13
|
+
Idle = "idle",
|
|
14
|
+
Creating = "creating",
|
|
15
|
+
Moving = "moving",
|
|
16
|
+
Resizing = "resizing",
|
|
17
|
+
DragSelecting = "dragSelecting"
|
|
18
|
+
}
|
|
19
|
+
export declare enum AnnotationHandleKind {
|
|
20
|
+
Resize = "resize",
|
|
21
|
+
Vertex = "vertex",
|
|
22
|
+
AddVertex = "addVertex",
|
|
23
|
+
Keypoint = "keypoint"
|
|
24
|
+
}
|
|
25
|
+
export interface AnnotationHandleDefinition {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly kind: AnnotationHandleKind;
|
|
28
|
+
readonly point: Point;
|
|
29
|
+
readonly cursor: string;
|
|
30
|
+
readonly geometryIndex?: number;
|
|
31
|
+
readonly edgeIndex?: number;
|
|
32
|
+
readonly radius: number;
|
|
33
|
+
readonly hitSize: number;
|
|
34
|
+
}
|
|
35
|
+
export interface AnnotationPointerInput {
|
|
36
|
+
readonly point: Point;
|
|
37
|
+
readonly timestamp: number;
|
|
38
|
+
readonly button?: number;
|
|
39
|
+
readonly shiftKey?: boolean;
|
|
40
|
+
readonly altKey?: boolean;
|
|
41
|
+
readonly ctrlKey?: boolean;
|
|
42
|
+
readonly metaKey?: boolean;
|
|
43
|
+
readonly detail?: number;
|
|
44
|
+
readonly pointerId?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface AnnotationCreationTool {
|
|
47
|
+
readonly geometry: AnnotationGeometryKind;
|
|
48
|
+
createDetection(geometry: Rect | readonly Point[]): Detection;
|
|
49
|
+
readonly minVertices?: number;
|
|
50
|
+
readonly mode?: "drag" | "multiClick" | "freehand";
|
|
51
|
+
readonly shouldCommit?: (geometry: Rect | readonly Point[]) => boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface AnnotationEditingState {
|
|
54
|
+
readonly kind: AnnotationGestureStateKind;
|
|
55
|
+
readonly preview: Detection | null;
|
|
56
|
+
readonly activeDetectionId: string | number | null;
|
|
57
|
+
readonly activeHandleId: string | null;
|
|
58
|
+
readonly pointerId: number | null;
|
|
59
|
+
}
|
|
60
|
+
export interface AnnotationEditingEngineOptions {
|
|
61
|
+
readonly viewportScale?: () => number;
|
|
62
|
+
readonly onStateChange?: (state: AnnotationEditingState) => void;
|
|
63
|
+
readonly onPreview?: (preview: Detection | null) => void;
|
|
64
|
+
readonly onCommit?: (detection: Detection, previous: Detection | null) => void;
|
|
65
|
+
readonly onCancel?: () => void;
|
|
66
|
+
readonly onFastTranslate?: (id: string | number, dx: number, dy: number) => void;
|
|
67
|
+
readonly capturePointer?: (pointerId: number) => void;
|
|
68
|
+
readonly releasePointer?: (pointerId: number) => void;
|
|
69
|
+
}
|
|
70
|
+
export interface AnnotationEditingEngine {
|
|
71
|
+
getState(): AnnotationEditingState;
|
|
72
|
+
setCreationTool(tool: AnnotationCreationTool | null): void;
|
|
73
|
+
pointerDown(input: AnnotationPointerInput, pick?: DetectionPickResult | null): void;
|
|
74
|
+
pointerMove(input: AnnotationPointerInput): void;
|
|
75
|
+
pointerUp(input: AnnotationPointerInput): void;
|
|
76
|
+
keyDown(key: string): void;
|
|
77
|
+
beginHandleDrag(detection: Detection, handle: AnnotationHandleDefinition, input: AnnotationPointerInput): void;
|
|
78
|
+
deleteVertex(detection: Detection, vertexIndex: number): Detection | null;
|
|
79
|
+
cancel(): void;
|
|
80
|
+
hasCreationTool(): boolean;
|
|
81
|
+
subscribe(listener: (state: AnnotationEditingState) => void): () => void;
|
|
82
|
+
subscribeFastTranslate(listener: (id: string | number, dx: number, dy: number) => void): () => void;
|
|
83
|
+
}
|
|
84
|
+
export interface PreviewOverlayPoint extends Point {
|
|
85
|
+
readonly positive: boolean;
|
|
86
|
+
}
|
|
87
|
+
export interface PreviewOverlayData {
|
|
88
|
+
readonly hoverPolygons?: readonly (readonly Point[])[];
|
|
89
|
+
readonly draftPolygons?: readonly (readonly Point[])[];
|
|
90
|
+
readonly points?: readonly PreviewOverlayPoint[];
|
|
91
|
+
}
|
|
92
|
+
/** Presentation context for a live annotation editing preview. */
|
|
93
|
+
export interface AnnotationEditingPreviewStyleContext {
|
|
94
|
+
readonly gestureKind: AnnotationGestureStateKind;
|
|
95
|
+
/** Media-to-screen scale. Screen-space style values are divided by this. */
|
|
96
|
+
readonly viewportScale: number;
|
|
97
|
+
}
|
|
98
|
+
/** Renderer-neutral presentation for editing affordances and previews. */
|
|
99
|
+
export interface AnnotationOverlayStyle {
|
|
100
|
+
readonly editingPreview?: {
|
|
101
|
+
/**
|
|
102
|
+
* Static or annotation-aware preview styling. Resolver support keeps
|
|
103
|
+
* creation, move, and resize previews aligned with the annotation class.
|
|
104
|
+
*/
|
|
105
|
+
readonly stroke?: DetectionStyleValue<BoxStrokeStyle, AnnotationEditingPreviewStyleContext>;
|
|
106
|
+
/** Fill for box creation previews. */
|
|
107
|
+
readonly boxFill?: DetectionStyleValue<BoxFillStyle, AnnotationEditingPreviewStyleContext>;
|
|
108
|
+
readonly polygonFill?: DetectionStyleValue<BoxFillStyle, AnnotationEditingPreviewStyleContext>;
|
|
109
|
+
readonly closeZoneStroke?: DetectionStyleValue<BoxStrokeStyle, AnnotationEditingPreviewStyleContext>;
|
|
110
|
+
};
|
|
111
|
+
readonly selectionHandle?: {
|
|
112
|
+
/**
|
|
113
|
+
* Static or annotation-aware handle fills. Resolver support keeps handles
|
|
114
|
+
* visually aligned with each selected annotation, including multi-select.
|
|
115
|
+
*/
|
|
116
|
+
readonly fill?: DetectionStyleValue<BoxFillStyle, AnnotationStyleContext>;
|
|
117
|
+
readonly stroke?: DetectionStyleValue<BoxStrokeStyle, AnnotationStyleContext>;
|
|
118
|
+
readonly addVertexAlpha?: number;
|
|
119
|
+
};
|
|
120
|
+
readonly marquee?: {
|
|
121
|
+
readonly fill?: BoxFillStyle;
|
|
122
|
+
};
|
|
123
|
+
readonly guide?: {
|
|
124
|
+
readonly stroke?: BoxStrokeStyle;
|
|
125
|
+
readonly shadowStroke?: BoxStrokeStyle;
|
|
126
|
+
};
|
|
127
|
+
readonly externalPreview?: {
|
|
128
|
+
readonly hoverFill?: BoxFillStyle;
|
|
129
|
+
readonly hoverStroke?: BoxStrokeStyle;
|
|
130
|
+
readonly draftFill?: BoxFillStyle;
|
|
131
|
+
readonly draftStroke?: BoxStrokeStyle;
|
|
132
|
+
readonly positivePointFill?: BoxFillStyle;
|
|
133
|
+
readonly negativePointFill?: BoxFillStyle;
|
|
134
|
+
readonly pointStroke?: BoxStrokeStyle;
|
|
135
|
+
};
|
|
136
|
+
readonly loading?: {
|
|
137
|
+
readonly stroke?: BoxStrokeStyle;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=editing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editing.d.ts","sourceRoot":"","sources":["../../src/types/editing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAChE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,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;KAClC,CAAC;IACF,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjB,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;KAC9B,CAAC;IACF,QAAQ,CAAC,KAAK,CAAC,EAAE;QACf,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;QACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC;KACxC,CAAC;IACF,QAAQ,CAAC,eAAe,CAAC,EAAE;QACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC;QAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC;QACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC;QAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC;QACtC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC;QAC1C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC;QAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,CAAC;KACvC,CAAC;IACF,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjB,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;KAClC,CAAC;CACH"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BoxShape } from "#types/box-style";
|
|
2
|
+
import type { DetectionFrame } from "#types/detections";
|
|
3
|
+
import type { DetectionPickResult } from "#types/interaction";
|
|
4
|
+
export type FocusStyleValue<T> = T | ((context: FocusStyleContext) => T);
|
|
5
|
+
export declare enum FocusTargetMode {
|
|
6
|
+
Hovered = "hovered",
|
|
7
|
+
Selected = "selected",
|
|
8
|
+
HoveredAndSelected = "hoveredAndSelected",
|
|
9
|
+
Ambient = "ambient"
|
|
10
|
+
}
|
|
11
|
+
export interface FocusFillStyle {
|
|
12
|
+
readonly color: number;
|
|
13
|
+
readonly alpha: number;
|
|
14
|
+
}
|
|
15
|
+
export interface FocusFallbackStyle {
|
|
16
|
+
readonly shape: BoxShape;
|
|
17
|
+
readonly cornerRadius?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface FocusStyleContext {
|
|
20
|
+
readonly mediaTime: number;
|
|
21
|
+
readonly frame: DetectionFrame;
|
|
22
|
+
readonly hoveredPick: DetectionPickResult | null;
|
|
23
|
+
readonly selectedPick: DetectionPickResult | null;
|
|
24
|
+
readonly viewportScale?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface FocusDrawInstruction {
|
|
27
|
+
readonly fill: FocusFillStyle;
|
|
28
|
+
readonly targets: readonly DetectionPickResult[];
|
|
29
|
+
readonly targetMode?: FocusTargetMode;
|
|
30
|
+
readonly fallback?: FocusFallbackStyle;
|
|
31
|
+
readonly ambient?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface FocusStyle {
|
|
34
|
+
resolve(context: FocusStyleContext): FocusDrawInstruction | undefined;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=focus-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus-style.d.ts","sourceRoot":"","sources":["../../src/types/focus-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,iBAAiB,KAAK,CAAC,CAAC,CAAC;AAEzE,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,kBAAkB,uBAAuB;IACzC,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACjD,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,oBAAoB,GAAG,SAAS,CAAC;CACvE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { BoxStyle } from "#types/box-style";
|
|
2
|
+
import type { Detection } from "#types/detections";
|
|
3
|
+
import type { DetectionPickPoint, DetectionPickTarget } from "#types/interaction";
|
|
4
|
+
import type { LabelStyle } from "#types/label-style";
|
|
5
|
+
import type { MaskStyle } from "#types/mask-style";
|
|
6
|
+
import type { PolygonStyle } from "#types/polygon-style";
|
|
7
|
+
import type { PolylineStyle } from "#types/polyline-style";
|
|
8
|
+
import type { KeypointStyle } from "#types/keypoint-style";
|
|
9
|
+
import type { AnnotationStyleContext } from "#types/style";
|
|
10
|
+
export declare enum DetectionInteractionState {
|
|
11
|
+
Hovered = "hovered",
|
|
12
|
+
Selected = "selected"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Per-frame context passed to an interaction style while resolving hover and
|
|
16
|
+
* selected highlight instructions.
|
|
17
|
+
*/
|
|
18
|
+
export interface InteractionStyleContext extends AnnotationStyleContext {
|
|
19
|
+
readonly state: DetectionInteractionState;
|
|
20
|
+
readonly target: DetectionPickTarget;
|
|
21
|
+
readonly point: DetectionPickPoint;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* State-specific presentation applied only to the active interaction target.
|
|
25
|
+
*
|
|
26
|
+
* These are the same renderer-neutral style contracts used by the base
|
|
27
|
+
* presentation. Interaction state should not invent a separate primitive or
|
|
28
|
+
* force mask interactions through rectangular box highlights.
|
|
29
|
+
*/
|
|
30
|
+
export interface InteractionPresentation {
|
|
31
|
+
readonly boxStyle?: BoxStyle | null;
|
|
32
|
+
readonly labelStyle?: LabelStyle | null;
|
|
33
|
+
readonly maskStyle?: MaskStyle | null;
|
|
34
|
+
readonly polygonStyle?: PolygonStyle | null;
|
|
35
|
+
readonly polylineStyle?: PolylineStyle | null;
|
|
36
|
+
readonly keypointStyle?: KeypointStyle | null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Presentation contract for hover and selected detection highlights.
|
|
40
|
+
*/
|
|
41
|
+
export interface InteractionStyle {
|
|
42
|
+
resolve(detection: Detection, context: InteractionStyleContext): InteractionPresentation | undefined;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=interaction-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-style.d.ts","sourceRoot":"","sources":["../../src/types/interaction-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EACV,kBAAkB,EAClB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|
|
|
1
|
+
import type { Detection, DetectionFrame } from "#types/detections";
|
|
2
|
+
export declare enum DetectionPickTarget {
|
|
3
|
+
Box = "box",
|
|
4
|
+
Edge = "edge",
|
|
5
|
+
Keypoint = "keypoint",
|
|
6
|
+
Label = "label",
|
|
7
|
+
Mask = "mask",
|
|
8
|
+
Polygon = "polygon",
|
|
9
|
+
Polyline = "polyline"
|
|
10
|
+
}
|
|
11
|
+
export declare enum MediaInteractionMode {
|
|
12
|
+
Always = "always",
|
|
13
|
+
Disabled = "disabled",
|
|
14
|
+
PausedOnly = "pausedOnly"
|
|
15
|
+
}
|
|
16
|
+
export interface DetectionPickPoint {
|
|
17
|
+
readonly x: number;
|
|
18
|
+
readonly y: number;
|
|
19
|
+
}
|
|
20
|
+
export interface DetectionPickResult {
|
|
21
|
+
readonly detection: Detection;
|
|
22
|
+
readonly detectionIndex: number;
|
|
23
|
+
readonly frame: DetectionFrame;
|
|
24
|
+
readonly mediaTime: number;
|
|
25
|
+
readonly point: DetectionPickPoint;
|
|
26
|
+
readonly target: DetectionPickTarget;
|
|
27
|
+
/** Index of the keypoint or edge when the target identifies a sub-geometry. */
|
|
28
|
+
readonly geometryIndex?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface DetectionPickOptions {
|
|
31
|
+
readonly padding?: number;
|
|
32
|
+
readonly polylinePadding?: number;
|
|
33
|
+
readonly keypointPadding?: number;
|
|
34
|
+
readonly edgePadding?: number;
|
|
35
|
+
/** Media dimensions used to map media-space points into mask raster space. */
|
|
36
|
+
readonly maskMediaDimensions?: {
|
|
37
|
+
readonly width: number;
|
|
38
|
+
readonly height: number;
|
|
39
|
+
};
|
|
40
|
+
readonly includeLocked?: boolean;
|
|
41
|
+
readonly includeMasks?: boolean;
|
|
42
|
+
readonly filter?: (detection: Detection, detectionIndex: number) => boolean;
|
|
43
|
+
}
|
|
44
|
+
interface DetectionSelectionOptionsBase {
|
|
45
|
+
readonly mediaTime?: number;
|
|
46
|
+
readonly point?: DetectionPickPoint;
|
|
47
|
+
readonly target?: DetectionPickTarget;
|
|
48
|
+
}
|
|
49
|
+
export type DetectionSelectionOptions = DetectionSelectionOptionsBase & ({
|
|
50
|
+
readonly detectionId: string | number;
|
|
51
|
+
readonly detectionIndex?: number;
|
|
52
|
+
} | {
|
|
53
|
+
readonly detectionId?: string | number;
|
|
54
|
+
readonly detectionIndex: number;
|
|
55
|
+
});
|
|
56
|
+
export interface MediaInteractionOptions extends DetectionPickOptions {
|
|
57
|
+
readonly mode?: MediaInteractionMode;
|
|
58
|
+
readonly onHover?: (pick: DetectionPickResult | null) => void;
|
|
59
|
+
readonly onSelect?: (pick: DetectionPickResult | null) => void;
|
|
60
|
+
readonly multiSelect?: boolean;
|
|
61
|
+
readonly onSelectionChange?: (picks: readonly DetectionPickResult[]) => void;
|
|
62
|
+
readonly onMarqueeChange?: (rect: {
|
|
63
|
+
readonly x: number;
|
|
64
|
+
readonly y: number;
|
|
65
|
+
readonly width: number;
|
|
66
|
+
readonly height: number;
|
|
67
|
+
} | null) => void;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=interaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../src/types/interaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnE,oBAAY,mBAAmB;IAC7B,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,oBAAY,oBAAoB;IAC9B,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CA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G,MAAM,CAAC;IACtC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC,GACD;IACE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC,CACJ,CAAC;AAEJ,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9D,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,KAAK,IAAI,CAAC;IAC7E,QAAQ,CAAC,eAAe,CAAC,EAAE,CACzB,IAAI,EAAE;QACJ,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,GAAG,IAAI,KACL,IAAI,CAAC;CACX"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BoxFillStyle, BoxStrokeStyle } from "#types/box-style";
|
|
2
|
+
import type { Detection, Point } from "#types/detections";
|
|
3
|
+
import type { AnnotationStyleContext } from "#types/style";
|
|
4
|
+
export type KeypointStyleContext = AnnotationStyleContext;
|
|
5
|
+
export declare enum KeypointMarkerShape {
|
|
6
|
+
Circle = "circle",
|
|
7
|
+
Cross = "cross"
|
|
8
|
+
}
|
|
9
|
+
export interface KeypointMarkerDrawInstruction {
|
|
10
|
+
readonly index: number;
|
|
11
|
+
readonly point: Point;
|
|
12
|
+
readonly radius: number;
|
|
13
|
+
readonly shape: KeypointMarkerShape;
|
|
14
|
+
readonly fill?: BoxFillStyle;
|
|
15
|
+
readonly stroke?: BoxStrokeStyle;
|
|
16
|
+
}
|
|
17
|
+
export interface KeypointEdgeDrawInstruction {
|
|
18
|
+
readonly from: Point;
|
|
19
|
+
readonly to: Point;
|
|
20
|
+
readonly stroke: BoxStrokeStyle;
|
|
21
|
+
readonly shadowStroke?: BoxStrokeStyle;
|
|
22
|
+
}
|
|
23
|
+
export interface KeypointDrawInstruction {
|
|
24
|
+
readonly markers: readonly KeypointMarkerDrawInstruction[];
|
|
25
|
+
readonly edges: readonly KeypointEdgeDrawInstruction[];
|
|
26
|
+
}
|
|
27
|
+
export interface KeypointStyle {
|
|
28
|
+
resolve(detection: Detection, context: KeypointStyleContext): KeypointDrawInstruction | undefined;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=keypoint-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keypoint-style.d.ts","sourceRoot":"","sources":["../../src/types/keypoint-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D,oBAAY,mBAAmB;IAC7B,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;CAClC;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC;CACxC;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,SAAS,6BAA6B,EAAE,CAAC;IAC3D,QAAQ,CAAC,KAAK,EAAE,SAAS,2BAA2B,EAAE,CAAC;CACxD;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,oBAAoB,GAC5B,uBAAuB,GAAG,SAAS,CAAC;CACxC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Detection, Rect } from "#types/detections";
|
|
2
|
+
import type { AnnotationStyleContext } from "#types/style";
|
|
3
|
+
export declare enum LabelPlacement {
|
|
4
|
+
Top = "top",
|
|
5
|
+
Bottom = "bottom",
|
|
6
|
+
InsideTop = "insideTop",
|
|
7
|
+
InsideBottom = "insideBottom",
|
|
8
|
+
Center = "center"
|
|
9
|
+
}
|
|
10
|
+
export declare enum LabelVisibilityMode {
|
|
11
|
+
Always = "always",
|
|
12
|
+
HoveredOnly = "hoveredOnly"
|
|
13
|
+
}
|
|
14
|
+
export type LabelStyleContext = AnnotationStyleContext;
|
|
15
|
+
/**
|
|
16
|
+
* Text styling for a rendered detection label.
|
|
17
|
+
*/
|
|
18
|
+
export interface LabelTextStyle {
|
|
19
|
+
readonly color: number;
|
|
20
|
+
readonly alpha?: number;
|
|
21
|
+
readonly fontFamily?: string;
|
|
22
|
+
readonly fontSize?: number;
|
|
23
|
+
readonly fontWeight?: string | number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Background styling for a rendered detection label.
|
|
27
|
+
*/
|
|
28
|
+
export interface LabelBackgroundStyle {
|
|
29
|
+
readonly color: number;
|
|
30
|
+
readonly alpha: number;
|
|
31
|
+
readonly cornerRadius?: number;
|
|
32
|
+
readonly paddingX?: number;
|
|
33
|
+
readonly paddingY?: number;
|
|
34
|
+
/** Round only the two top corners, matching editor label pills. */
|
|
35
|
+
readonly topCornersOnly?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Label offset in media pixels.
|
|
39
|
+
*/
|
|
40
|
+
export interface LabelOffsetStyle {
|
|
41
|
+
readonly x?: number;
|
|
42
|
+
readonly y?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Renderer-neutral label drawing instruction.
|
|
46
|
+
*/
|
|
47
|
+
export interface LabelDrawInstruction {
|
|
48
|
+
readonly rect: Rect;
|
|
49
|
+
readonly text: string;
|
|
50
|
+
readonly textStyle?: LabelTextStyle;
|
|
51
|
+
readonly background?: LabelBackgroundStyle;
|
|
52
|
+
readonly offsetX?: number;
|
|
53
|
+
readonly offsetY?: number;
|
|
54
|
+
readonly placement?: LabelPlacement;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Label presentation contract.
|
|
58
|
+
*
|
|
59
|
+
* This is the `supervision-js` equivalent of a label annotator: it converts one
|
|
60
|
+
* semantic detection into optional label text and renderer-neutral style data.
|
|
61
|
+
*/
|
|
62
|
+
export interface LabelStyle {
|
|
63
|
+
resolve(detection: Detection, context: LabelStyleContext): LabelDrawInstruction | undefined;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=label-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-style.d.ts","sourceRoot":"","sources":["../../src/types/label-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,m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