supervision 0.1.3 → 0.1.5

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.
Files changed (121) hide show
  1. package/dist/index.d.ts +16 -4
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1587 -177
  4. package/dist/index.js.map +1 -1
  5. package/dist/mask-preparation.worker.js +110 -68
  6. package/dist/mask-preparation.worker.js.map +1 -1
  7. package/dist/post-processing/default-tracking-worker.d.ts +3 -0
  8. package/dist/post-processing/default-tracking-worker.d.ts.map +1 -0
  9. package/dist/post-processing/detection-post-processing-pipeline.d.ts +7 -0
  10. package/dist/post-processing/detection-post-processing-pipeline.d.ts.map +1 -0
  11. package/dist/post-processing/embedded-tracking-worker.d.ts +2 -0
  12. package/dist/post-processing/embedded-tracking-worker.d.ts.map +1 -0
  13. package/dist/post-processing/tracking-worker-protocol.d.ts +29 -0
  14. package/dist/post-processing/tracking-worker-protocol.d.ts.map +1 -0
  15. package/dist/post-processing/tracking.worker.d.ts +2 -0
  16. package/dist/post-processing/tracking.worker.d.ts.map +1 -0
  17. package/dist/render-preparation/mask-frame-artifact.d.ts +6 -0
  18. package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
  19. package/dist/render-preparation/mask-frame-compositor.d.ts +1 -0
  20. package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -1
  21. package/dist/render-preparation/mask-frame-preparer.d.ts.map +1 -1
  22. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +1 -0
  23. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
  24. package/dist/renderers/annotation-shape-styles.d.ts +17 -0
  25. package/dist/renderers/annotation-shape-styles.d.ts.map +1 -0
  26. package/dist/renderers/media-renderer-core.d.ts.map +1 -1
  27. package/dist/renderers/media-renderer-scene.d.ts +17 -2
  28. package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
  29. package/dist/renderers/pixi-annotation-overlay-layer.d.ts.map +1 -1
  30. package/dist/renderers/pixi-focus-layer.d.ts +1 -0
  31. package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
  32. package/dist/renderers/pixi-interaction-layer.d.ts +2 -0
  33. package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -1
  34. package/dist/renderers/pixi-interaction-presentation-layer.d.ts +2 -1
  35. package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
  36. package/dist/renderers/pixi-mask-halo.d.ts +94 -0
  37. package/dist/renderers/pixi-mask-halo.d.ts.map +1 -0
  38. package/dist/renderers/pixi-mask-layer.d.ts +10 -1
  39. package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
  40. package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
  41. package/dist/renderers/pixi-path.d.ts +13 -7
  42. package/dist/renderers/pixi-path.d.ts.map +1 -1
  43. package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
  44. package/dist/renderers/pixi-region-layer.d.ts +42 -0
  45. package/dist/renderers/pixi-region-layer.d.ts.map +1 -0
  46. package/dist/renderers/pixi-scene-layer-slot.d.ts +1 -0
  47. package/dist/renderers/pixi-scene-layer-slot.d.ts.map +1 -1
  48. package/dist/renderers/pixi-vector-layer.d.ts +3 -1
  49. package/dist/renderers/pixi-vector-layer.d.ts.map +1 -1
  50. package/dist/sessions/media-session.d.ts.map +1 -1
  51. package/dist/tracking.worker.js +1485 -0
  52. package/dist/tracking.worker.js.map +1 -0
  53. package/dist/types/detection-post-processing.d.ts +62 -0
  54. package/dist/types/detection-post-processing.d.ts.map +1 -0
  55. package/dist/types/media-renderer.d.ts +1 -1
  56. package/dist/types/media-renderer.d.ts.map +1 -1
  57. package/dist/workers/worker-rpc-client.d.ts +2 -1
  58. package/dist/workers/worker-rpc-client.d.ts.map +1 -1
  59. package/node_modules/supervision-js-core/dist/index.d.ts +23 -3
  60. package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
  61. package/node_modules/supervision-js-core/dist/index.js +2545 -566
  62. package/node_modules/supervision-js-core/dist/index.js.map +1 -1
  63. package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts +18 -0
  64. package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts.map +1 -1
  65. package/node_modules/supervision-js-core/dist/post-processing/byte-track-tracker.d.ts +4 -0
  66. package/node_modules/supervision-js-core/dist/post-processing/byte-track-tracker.d.ts.map +1 -0
  67. package/node_modules/supervision-js-core/dist/post-processing/cbiou-tracker.d.ts +4 -0
  68. package/node_modules/supervision-js-core/dist/post-processing/cbiou-tracker.d.ts.map +1 -0
  69. package/node_modules/supervision-js-core/dist/post-processing/oc-sort-tracker.d.ts +4 -0
  70. package/node_modules/supervision-js-core/dist/post-processing/oc-sort-tracker.d.ts.map +1 -0
  71. package/node_modules/supervision-js-core/dist/post-processing/sort-tracker.d.ts +4 -0
  72. package/node_modules/supervision-js-core/dist/post-processing/sort-tracker.d.ts.map +1 -0
  73. package/node_modules/supervision-js-core/dist/post-processing/tracking.d.ts +9 -0
  74. package/node_modules/supervision-js-core/dist/post-processing/tracking.d.ts.map +1 -0
  75. package/node_modules/supervision-js-core/dist/styles/annotation-renderer-presentation.d.ts.map +1 -1
  76. package/node_modules/supervision-js-core/dist/styles/annotation-renderer-registry.d.ts +13 -6
  77. package/node_modules/supervision-js-core/dist/styles/annotation-renderer-registry.d.ts.map +1 -1
  78. package/node_modules/supervision-js-core/dist/styles/box-corner-style.d.ts +14 -0
  79. package/node_modules/supervision-js-core/dist/styles/box-corner-style.d.ts.map +1 -0
  80. package/node_modules/supervision-js-core/dist/styles/box-style.d.ts.map +1 -1
  81. package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts +19 -0
  82. package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map +1 -1
  83. package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts.map +1 -1
  84. package/node_modules/supervision-js-core/dist/styles/keypoint-style.d.ts.map +1 -1
  85. package/node_modules/supervision-js-core/dist/styles/marker-style.d.ts +14 -0
  86. package/node_modules/supervision-js-core/dist/styles/marker-style.d.ts.map +1 -0
  87. package/node_modules/supervision-js-core/dist/styles/polygon-style.d.ts.map +1 -1
  88. package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts.map +1 -1
  89. package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts +8 -0
  90. package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts.map +1 -1
  91. package/node_modules/supervision-js-core/dist/styles/stroke-style.d.ts +12 -0
  92. package/node_modules/supervision-js-core/dist/styles/stroke-style.d.ts.map +1 -0
  93. package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +124 -4
  94. package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -1
  95. package/node_modules/supervision-js-core/dist/types/box-corner-style.d.ts +31 -0
  96. package/node_modules/supervision-js-core/dist/types/box-corner-style.d.ts.map +1 -0
  97. package/node_modules/supervision-js-core/dist/types/box-style.d.ts +4 -17
  98. package/node_modules/supervision-js-core/dist/types/box-style.d.ts.map +1 -1
  99. package/node_modules/supervision-js-core/dist/types/detections.d.ts +11 -3
  100. package/node_modules/supervision-js-core/dist/types/detections.d.ts.map +1 -1
  101. package/node_modules/supervision-js-core/dist/types/ellipse-style.d.ts +30 -0
  102. package/node_modules/supervision-js-core/dist/types/ellipse-style.d.ts.map +1 -0
  103. package/node_modules/supervision-js-core/dist/types/interaction.d.ts +12 -0
  104. package/node_modules/supervision-js-core/dist/types/interaction.d.ts.map +1 -1
  105. package/node_modules/supervision-js-core/dist/types/marker-style.d.ts +46 -0
  106. package/node_modules/supervision-js-core/dist/types/marker-style.d.ts.map +1 -0
  107. package/node_modules/supervision-js-core/dist/types/mask-halo-style.d.ts +29 -0
  108. package/node_modules/supervision-js-core/dist/types/mask-halo-style.d.ts.map +1 -0
  109. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +18 -2
  110. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
  111. package/node_modules/supervision-js-core/dist/types/paint-style.d.ts +36 -0
  112. package/node_modules/supervision-js-core/dist/types/paint-style.d.ts.map +1 -0
  113. package/node_modules/supervision-js-core/dist/types/post-processing.d.ts +148 -0
  114. package/node_modules/supervision-js-core/dist/types/post-processing.d.ts.map +1 -0
  115. package/node_modules/supervision-js-core/dist/types/shape-style.d.ts +112 -0
  116. package/node_modules/supervision-js-core/dist/types/shape-style.d.ts.map +1 -0
  117. package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts.map +1 -1
  118. package/node_modules/supervision-js-core/dist/utils/shape-geometry.d.ts +50 -0
  119. package/node_modules/supervision-js-core/dist/utils/shape-geometry.d.ts.map +1 -0
  120. package/node_modules/supervision-js-core/package.json +12 -5
  121. package/package.json +7 -2
@@ -0,0 +1,112 @@
1
+ import type { Detection, Point } from "#types/detections";
2
+ import type { FillStyle, OpenStrokeStyle, StrokeStyle } from "#types/paint-style";
3
+ import type { AnnotationStyleContext } from "#types/style";
4
+ /**
5
+ * Discriminator for renderer-neutral shape draw instructions.
6
+ */
7
+ export declare enum ShapeInstructionKind {
8
+ Ellipse = "ellipse",
9
+ Marker = "marker",
10
+ Path = "path"
11
+ }
12
+ export declare enum MarkerShape {
13
+ Circle = "circle",
14
+ Cross = "cross",
15
+ Square = "square",
16
+ Triangle = "triangle"
17
+ }
18
+ /**
19
+ * Coordinate space for marker sizing. Media sizes scale with the viewport;
20
+ * screen sizes stay constant on screen, matching stroke-width semantics.
21
+ */
22
+ export declare enum MarkerSizeSpace {
23
+ Media = "media",
24
+ Screen = "screen"
25
+ }
26
+ /**
27
+ * Ellipse or elliptical arc in media coordinates.
28
+ *
29
+ * Omitting both angles draws a closed ellipse. Angles are radians measured
30
+ * from the positive x axis before `rotation` is applied.
31
+ */
32
+ interface EllipseShapeInstructionBase {
33
+ readonly kind: ShapeInstructionKind.Ellipse;
34
+ readonly center: Point;
35
+ readonly radiusX: number;
36
+ readonly radiusY: number;
37
+ /** Rotation in radians around the center. */
38
+ readonly rotation?: number;
39
+ }
40
+ export interface ClosedEllipseShapeInstruction extends EllipseShapeInstructionBase {
41
+ readonly startAngle?: never;
42
+ readonly endAngle?: never;
43
+ readonly fill?: FillStyle;
44
+ readonly stroke?: StrokeStyle;
45
+ }
46
+ export interface EllipseArcShapeInstruction extends EllipseShapeInstructionBase {
47
+ readonly startAngle: number;
48
+ readonly endAngle: number;
49
+ readonly fill?: never;
50
+ readonly stroke?: OpenStrokeStyle;
51
+ }
52
+ export type EllipseShapeInstruction = ClosedEllipseShapeInstruction | EllipseArcShapeInstruction;
53
+ /**
54
+ * Anchored marker at a media-space point.
55
+ *
56
+ * At rotation `0` a triangle points toward positive y (down in media space).
57
+ * `center` is always the geometric center; semantic anchoring belongs to the
58
+ * renderer that creates this lower-level instruction.
59
+ */
60
+ interface MarkerShapeInstructionBase {
61
+ readonly kind: ShapeInstructionKind.Marker;
62
+ readonly center: Point;
63
+ /** Marker diameter in the declared size space. */
64
+ readonly size: number;
65
+ readonly sizeSpace: MarkerSizeSpace;
66
+ /** Rotation in radians around the center. */
67
+ readonly rotation?: number;
68
+ }
69
+ export interface ClosedMarkerShapeInstruction extends MarkerShapeInstructionBase {
70
+ readonly shape: MarkerShape.Circle | MarkerShape.Square | MarkerShape.Triangle;
71
+ readonly fill?: FillStyle;
72
+ readonly stroke?: StrokeStyle;
73
+ }
74
+ export interface CrossMarkerShapeInstruction extends MarkerShapeInstructionBase {
75
+ readonly shape: MarkerShape.Cross;
76
+ readonly fill?: never;
77
+ readonly stroke?: OpenStrokeStyle;
78
+ }
79
+ export type MarkerShapeInstruction = ClosedMarkerShapeInstruction | CrossMarkerShapeInstruction;
80
+ /**
81
+ * One or more disconnected subpaths sharing a single style.
82
+ */
83
+ interface PathShapeInstructionBase {
84
+ readonly kind: ShapeInstructionKind.Path;
85
+ readonly segments: readonly (readonly Point[])[];
86
+ }
87
+ export interface ClosedPathShapeInstruction extends PathShapeInstructionBase {
88
+ readonly closed: true;
89
+ readonly fill?: FillStyle;
90
+ readonly stroke: StrokeStyle;
91
+ }
92
+ export interface OpenPathShapeInstruction extends PathShapeInstructionBase {
93
+ readonly closed: false;
94
+ readonly fill?: never;
95
+ readonly stroke: OpenStrokeStyle;
96
+ }
97
+ export type PathShapeInstruction = ClosedPathShapeInstruction | OpenPathShapeInstruction;
98
+ export type ShapeDrawInstruction = EllipseShapeInstruction | MarkerShapeInstruction | PathShapeInstruction;
99
+ export type ShapeStyleContext = AnnotationStyleContext;
100
+ /**
101
+ * Shape decoration contract.
102
+ *
103
+ * A style receives semantic detections and returns renderer-neutral shape
104
+ * instructions derived from them. Shape decorations are presentation only:
105
+ * they are not pickable and never become editable annotations. Return
106
+ * `undefined` or an empty array to skip a detection.
107
+ */
108
+ export interface ShapeStyle {
109
+ resolve(detection: Detection, context: ShapeStyleContext): readonly ShapeDrawInstruction[] | undefined;
110
+ }
111
+ export {};
112
+ //# sourceMappingURL=shape-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape-style.d.ts","sourceRoot":"","sources":["../../src/types/shape-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED;;;GAGG;AACH,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED;;;;;GAKG;AACH,UAAU,2BAA2B;IACnC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC,OAAO,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S,CAAC;CAChD"}
@@ -1 +1 @@
1
- {"version":3,"file":"detection-frames.d.ts","sourceRoot":"","sources":["../../src/utils/detection-frames.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAOD,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,GACrD,cAAc,EAAE,CA0ClB;AAmCD,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,SAAS,cAAc,EAAE,GACzC,IAAI,CAuHN;AAsDD,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,SAAS,cAAc,EAAE,EAC1C,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,cAAc,EAAE,CAIlB;AAED,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,SAAS,cAAc,EAAE,EAC1C,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,8BAAmC,GAC3C,cAAc,GAAG,SAAS,CAe5B;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,aAAa,GAClB,oBAAoB,CAkCtB;AAoFD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,WAOhB;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,YA4BvD;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,UA0BlE"}
1
+ {"version":3,"file":"detection-frames.d.ts","sourceRoot":"","sources":["../../src/utils/detection-frames.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAOD,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,GACrD,cAAc,EAAE,CA0ClB;AAmCD,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,SAAS,cAAc,EAAE,GACzC,IAAI,CA8HN;AAsDD,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,SAAS,cAAc,EAAE,EAC1C,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,cAAc,EAAE,CAIlB;AAED,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,SAAS,cAAc,EAAE,EAC1C,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,8BAAmC,GAC3C,cAAc,GAAG,SAAS,CAe5B;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,aAAa,GAClB,oBAAoB,CAkCtB;AAoFD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,WAOhB;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,YA4BvD;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,UA0BlE"}
@@ -0,0 +1,50 @@
1
+ import type { Point } from "#types/detections";
2
+ import { MarkerShape, MarkerSizeSpace } from "#types/shape-style";
3
+ export interface EllipseGeometry {
4
+ readonly center: Point;
5
+ readonly radiusX: number;
6
+ readonly radiusY: number;
7
+ readonly rotation?: number;
8
+ readonly startAngle?: number;
9
+ readonly endAngle?: number;
10
+ }
11
+ export interface MarkerGeometryInput {
12
+ readonly center: Point;
13
+ readonly shape: MarkerShape;
14
+ readonly size: number;
15
+ readonly sizeSpace: MarkerSizeSpace;
16
+ readonly rotation?: number;
17
+ }
18
+ export interface SampledShapePath {
19
+ readonly closed: boolean;
20
+ readonly points: readonly Point[];
21
+ }
22
+ /**
23
+ * Samples an ellipse or elliptical arc into a deterministic polyline so every
24
+ * backend rasterizes the same structural geometry, including dashed strokes.
25
+ *
26
+ * A closed ellipse returns `segmentCount` points without repeating the first
27
+ * point; an open arc returns `segmentCount + 1` points including both
28
+ * endpoints.
29
+ */
30
+ export declare function sampleEllipseArc(ellipse: EllipseGeometry, segmentCount?: number): SampledShapePath;
31
+ /**
32
+ * Chooses a bounded segment count from the ellipse's on-screen radius. The
33
+ * result targets sub-pixel chord error without making tiny markers expensive.
34
+ */
35
+ export declare function resolveEllipseSegmentCount(ellipse: EllipseGeometry, viewportScale?: number, maxErrorPixels?: number): number;
36
+ export type MarkerGeometry = {
37
+ readonly kind: "circle";
38
+ readonly center: Point;
39
+ readonly radius: number;
40
+ } | {
41
+ readonly kind: "subpaths";
42
+ readonly closed: boolean;
43
+ readonly subpaths: readonly (readonly Point[])[];
44
+ };
45
+ /**
46
+ * Resolves a marker instruction into media-space geometry. Screen-space sizes
47
+ * are divided by the viewport scale, matching stroke-width semantics.
48
+ */
49
+ export declare function resolveMarkerGeometry(marker: MarkerGeometryInput, viewportScale?: number): MarkerGeometry;
50
+ //# sourceMappingURL=shape-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape-geometry.d.ts","sourceRoot":"","sources":["../../src/utils/shape-geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAQlE,MAAM,WAAW,eAAe;IAC9B,QA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ClD,CAAC;AAEN;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,mBAAmB,EAC3B,aAAa,SAAI,GAChB,cAAc,CAmEhB"}
@@ -23,6 +23,10 @@
23
23
  "types": "./dist/interactions/*.d.ts",
24
24
  "import": "./dist/interactions/*.js"
25
25
  },
26
+ "#post-processing/*": {
27
+ "types": "./dist/post-processing/*.d.ts",
28
+ "import": "./dist/post-processing/*.js"
29
+ },
26
30
  "#styles/*": {
27
31
  "types": "./dist/styles/*.d.ts",
28
32
  "import": "./dist/styles/*.js"
@@ -41,11 +45,14 @@
41
45
  ],
42
46
  "sideEffects": false,
43
47
  "scripts": {
44
- "build": "npm run clean && npm run build:types && npm run build:js",
45
- "build:js": "rollup -c",
46
- "build:types": "tsc --emitDeclarationOnly -p tsconfig.json",
48
+ "build": "npm run build -w supervision-js-trackers && npm run clean && npm run build:types:local && npm run build:js:local",
49
+ "build:js": "npm run build -w supervision-js-trackers && npm run build:js:local",
50
+ "build:js:local": "rollup -c",
51
+ "build:types": "npm run build:types -w supervision-js-trackers && npm run build:types:local",
52
+ "build:types:local": "tsc --emitDeclarationOnly -p tsconfig.json",
47
53
  "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
48
- "dev": "rollup -c -w",
49
- "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json"
54
+ "dev": "npm run build -w supervision-js-trackers && npm run dev:local",
55
+ "dev:local": "rollup -c -w",
56
+ "typecheck": "npm run build:types -w supervision-js-trackers && tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json"
50
57
  }
51
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supervision",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Browser-native computer vision media rendering and annotation engine.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,7 +36,8 @@
36
36
  "types": "./dist/editing.d.ts",
37
37
  "import": "./dist/editing.js"
38
38
  },
39
- "./render-preparation-worker": "./dist/mask-preparation.worker.js"
39
+ "./render-preparation-worker": "./dist/mask-preparation.worker.js",
40
+ "./detection-post-processing-worker": "./dist/tracking.worker.js"
40
41
  },
41
42
  "imports": {
42
43
  "#editing/*": {
@@ -59,6 +60,10 @@
59
60
  "types": "./dist/playback/*.d.ts",
60
61
  "import": "./dist/playback/*.js"
61
62
  },
63
+ "#post-processing/*": {
64
+ "types": "./dist/post-processing/*.d.ts",
65
+ "import": "./dist/post-processing/*.js"
66
+ },
62
67
  "#render-preparation/*": {
63
68
  "types": "./dist/render-preparation/*.d.ts",
64
69
  "import": "./dist/render-preparation/*.js"