supervision 0.2.4 → 0.2.6
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/dist/depth-preview-probe-DG7McQEN.js +314 -0
- package/dist/depth-preview-probe-DG7McQEN.js.map +1 -0
- package/dist/depth-preview-track-BvgwNEE9.js +612 -0
- package/dist/depth-preview-track-BvgwNEE9.js.map +1 -0
- package/dist/detections/chunked-detection-frame-source.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9504 -4719
- package/dist/index.js.map +1 -1
- package/dist/mask-preparation.worker.js +658 -21
- package/dist/mask-preparation.worker.js.map +1 -1
- package/dist/media/decoder-deadline.d.ts +18 -0
- package/dist/media/decoder-deadline.d.ts.map +1 -0
- package/dist/media/depth-preview-probe.d.ts +65 -0
- package/dist/media/depth-preview-probe.d.ts.map +1 -0
- package/dist/media/depth-preview-track.d.ts +96 -0
- package/dist/media/depth-preview-track.d.ts.map +1 -0
- package/dist/media/media-normalization.d.ts.map +1 -1
- package/dist/media/media-source.d.ts +7 -0
- package/dist/media/media-source.d.ts.map +1 -1
- package/dist/media/mediabunny-frame-clock.d.ts +7 -0
- package/dist/media/mediabunny-frame-clock.d.ts.map +1 -0
- package/dist/media/mediabunny-media-source.d.ts +3 -0
- package/dist/media/mediabunny-media-source.d.ts.map +1 -1
- package/dist/media/track-frame-index.d.ts +14 -0
- package/dist/media/track-frame-index.d.ts.map +1 -0
- package/dist/media/video-engine-media-source.d.ts.map +1 -1
- package/dist/media/video-engine-media-source.js +1 -1
- package/dist/render-preparation/depth/clip-preview.d.ts +41 -0
- package/dist/render-preparation/depth/clip-preview.d.ts.map +1 -0
- package/dist/render-preparation/depth/clip-timing.d.ts +18 -0
- package/dist/render-preparation/depth/clip-timing.d.ts.map +1 -0
- package/dist/render-preparation/depth/clip.d.ts +14 -0
- package/dist/render-preparation/depth/clip.d.ts.map +1 -0
- package/dist/render-preparation/depth/exact-at-rest.d.ts +44 -0
- package/dist/render-preparation/depth/exact-at-rest.d.ts.map +1 -0
- package/dist/render-preparation/depth/exact-playback.d.ts +40 -0
- package/dist/render-preparation/depth/exact-playback.d.ts.map +1 -0
- package/dist/render-preparation/depth/files.d.ts +55 -0
- package/dist/render-preparation/depth/files.d.ts.map +1 -0
- package/dist/render-preparation/depth/frame-decode.d.ts +20 -0
- package/dist/render-preparation/depth/frame-decode.d.ts.map +1 -0
- package/dist/render-preparation/depth/frame-preparer.d.ts +51 -0
- package/dist/render-preparation/depth/frame-preparer.d.ts.map +1 -0
- package/dist/render-preparation/depth/frame-window.d.ts +146 -0
- package/dist/render-preparation/depth/frame-window.d.ts.map +1 -0
- package/dist/render-preparation/depth/options.d.ts +37 -0
- package/dist/render-preparation/depth/options.d.ts.map +1 -0
- package/dist/render-preparation/depth/png16.d.ts +40 -0
- package/dist/render-preparation/depth/png16.d.ts.map +1 -0
- package/dist/render-preparation/depth/preview-luma-copier.d.ts +12 -0
- package/dist/render-preparation/depth/preview-luma-copier.d.ts.map +1 -0
- package/dist/render-preparation/depth/preview-luma.d.ts +48 -0
- package/dist/render-preparation/depth/preview-luma.d.ts.map +1 -0
- package/dist/render-preparation/depth/source.d.ts +123 -0
- package/dist/render-preparation/depth/source.d.ts.map +1 -0
- package/dist/render-preparation/depth/worker-protocol.d.ts +76 -0
- package/dist/render-preparation/depth/worker-protocol.d.ts.map +1 -0
- package/dist/render-preparation/playhead-motion.d.ts +67 -0
- package/dist/render-preparation/playhead-motion.d.ts.map +1 -0
- package/dist/render-preparation/prepared-render-window.d.ts +12 -0
- package/dist/render-preparation/prepared-render-window.d.ts.map +1 -1
- package/dist/renderers/depth-textures.d.ts +79 -0
- package/dist/renderers/depth-textures.d.ts.map +1 -0
- package/dist/renderers/id-mask-stroke-coverage.d.ts +3 -0
- package/dist/renderers/id-mask-stroke-coverage.d.ts.map +1 -0
- package/dist/renderers/media-renderer-core.d.ts.map +1 -1
- package/dist/renderers/media-renderer-scene.d.ts +14 -1
- package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
- package/dist/renderers/pixi-batch-texture-bindings.d.ts +9 -0
- package/dist/renderers/pixi-batch-texture-bindings.d.ts.map +1 -0
- package/dist/renderers/pixi-depth-layer.d.ts +76 -0
- package/dist/renderers/pixi-depth-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-depth-shader.d.ts +76 -0
- package/dist/renderers/pixi-depth-shader.d.ts.map +1 -0
- package/dist/renderers/pixi-focus-layer.d.ts +1 -0
- package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-frame-present.d.ts +1 -0
- package/dist/renderers/pixi-frame-present.d.ts.map +1 -1
- package/dist/renderers/pixi-id-mask-shader.d.ts +1 -0
- package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-layer.d.ts +1 -1
- package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts +1 -0
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-halo.d.ts +1 -0
- package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-layer.d.ts +4 -0
- package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
- package/dist/renderers/pixi-region-coverage-mask.d.ts +1 -0
- package/dist/renderers/pixi-region-coverage-mask.d.ts.map +1 -1
- package/dist/renderers/pixi-region-layer.d.ts +1 -0
- package/dist/renderers/pixi-region-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-scene-layer-slot.d.ts +1 -0
- package/dist/renderers/pixi-scene-layer-slot.d.ts.map +1 -1
- package/dist/renderers/prepared-annotation-window.d.ts +1 -0
- package/dist/renderers/prepared-annotation-window.d.ts.map +1 -1
- package/dist/renderers/render-preparation-report.d.ts +23 -0
- package/dist/renderers/render-preparation-report.d.ts.map +1 -0
- package/dist/sessions/media-session-defaults.d.ts.map +1 -1
- package/dist/sessions/media-session-state.d.ts.map +1 -1
- package/dist/sessions/media-session.d.ts.map +1 -1
- package/dist/tracking.worker.js +64 -0
- package/dist/tracking.worker.js.map +1 -1
- package/dist/types/media-depth.d.ts +55 -0
- package/dist/types/media-depth.d.ts.map +1 -0
- package/dist/types/media-renderer.d.ts +19 -0
- package/dist/types/media-renderer.d.ts.map +1 -1
- package/dist/types/media-session.d.ts +19 -0
- package/dist/types/media-session.d.ts.map +1 -1
- package/dist/types/render-preparation.d.ts +105 -3
- package/dist/types/render-preparation.d.ts.map +1 -1
- package/dist/{video-engine-media-source-DR-x1UfK.js → video-engine-media-source-DOFsuGS4.js} +35 -29
- package/dist/video-engine-media-source-DOFsuGS4.js.map +1 -0
- package/dist/web-video-engine/analysis.js +6 -43
- package/dist/web-video-engine/cache-budget.d.ts +4 -7
- package/dist/web-video-engine/constants.d.ts +3 -4
- package/dist/web-video-engine/create-scrub-cursor.d.ts +1 -0
- package/dist/web-video-engine/decode-resolution-fynpRIAG.js +109 -0
- package/dist/web-video-engine/decode-scheduler.d.ts +1 -0
- package/dist/web-video-engine/engine-core.d.ts +4 -2
- package/dist/web-video-engine/engine.js +8 -6
- package/dist/web-video-engine/engine.worker.js +164 -66
- package/dist/web-video-engine/frame-cache.d.ts +9 -0
- package/dist/web-video-engine/frame-index.d.ts +1 -0
- package/dist/web-video-engine/frame-index.js +97 -0
- package/dist/web-video-engine/{frame-timeline-DreEwsRY.js → frame-timeline-CYgzzmpA.js} +1 -109
- package/dist/web-video-engine/frame-timeline-reader.d.ts +21 -0
- package/dist/web-video-engine/video-engine.d.ts +9 -4
- package/node_modules/supervision-js-core/THIRD_PARTY_NOTICES.md +132 -0
- package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.d.ts +7 -2
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.js +1138 -62
- package/node_modules/supervision-js-core/dist/index.js.map +1 -1
- package/node_modules/supervision-js-core/dist/interactions/annotation-editing-engine.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/interactions/annotation-handles.d.ts +2 -2
- package/node_modules/supervision-js-core/dist/interactions/annotation-handles.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/annotation-renderer-presentation.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/annotation-renderer-registry.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +50 -3
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/depth-map.d.ts +203 -0
- package/node_modules/supervision-js-core/dist/types/depth-map.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/editing.d.ts +4 -0
- package/node_modules/supervision-js-core/dist/types/editing.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +3 -0
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/depth-color-mapping.d.ts +91 -0
- package/node_modules/supervision-js-core/dist/utils/depth-color-mapping.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/depth-colormap-tables.d.ts +30 -0
- package/node_modules/supervision-js-core/dist/utils/depth-colormap-tables.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/depth-colormaps.d.ts +16 -0
- package/node_modules/supervision-js-core/dist/utils/depth-colormaps.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/depth-manifest.d.ts +23 -0
- package/node_modules/supervision-js-core/dist/utils/depth-manifest.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/depth-readout.d.ts +14 -0
- package/node_modules/supervision-js-core/dist/utils/depth-readout.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts +21 -0
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +3 -7
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -1
- package/node_modules/supervision-js-core/package.json +2 -1
- package/package.json +6 -1
- package/dist/video-engine-media-source-DR-x1UfK.js.map +0 -1
|
@@ -165,7 +165,7 @@ export declare const FRAME_TIMELINE: {
|
|
|
165
165
|
* session path that is a probe plus a walk from the enclosing sync sample,
|
|
166
166
|
* measured at 49ms mean / 80ms worst on a 2840x2840 15fps source, flat in how
|
|
167
167
|
* far the jump travelled. Coverage past the window is worth having, not worth
|
|
168
|
-
* having crisp, so it lives in the preview tier
|
|
168
|
+
* having crisp, so it lives in the smaller preview tier.
|
|
169
169
|
*
|
|
170
170
|
* resolveCacheBudgets turns these into a per-source budget from
|
|
171
171
|
* navigator.deviceMemory and the decode frame size. A crisp slot costs
|
|
@@ -187,9 +187,8 @@ export declare const FRAME_TIMELINE: {
|
|
|
187
187
|
* PREVIEW_SLOTS_MAX: the preview slot count is its byte budget over the
|
|
188
188
|
* downscaled frame size, capped here. No floor pairs with it: raising a starved
|
|
189
189
|
* count means overspending the byte budget, when the frame width is what a wide
|
|
190
|
-
* preview has to give up.
|
|
191
|
-
*
|
|
192
|
-
* exact tier's 13, 11s of a 15fps clip.
|
|
190
|
+
* preview has to give up. A 320px square preview costs about a 79th of an
|
|
191
|
+
* 8MP crisp slot, so that source keeps coarse history beyond its exact window.
|
|
193
192
|
*
|
|
194
193
|
* SKIP_NEAR_MS: cache lookups that resolve to a frame within this many
|
|
195
194
|
* milliseconds of what the visible canvas already shows are rejected so the
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode-resolution strategies. A strategy decides the pixel width each video
|
|
3
|
+
* frame is decoded to, independent of the source's native resolution. Height
|
|
4
|
+
* follows from native aspect, so a strategy only ever returns a width.
|
|
5
|
+
*
|
|
6
|
+
* Decoding below native trades preview sharpness for paint cost and frame-cache
|
|
7
|
+
* memory. It does NOT cut decode cost: the codec decodes the full coded frame
|
|
8
|
+
* regardless of target width, and CanvasSink resizes the result afterward. The
|
|
9
|
+
* win scales with the gap between source resolution and the on-screen box: a 4K
|
|
10
|
+
* source shown in a 640px surface still pays full 4K decode, but the smaller
|
|
11
|
+
* surface cuts the per-frame paint work and the cached blit size.
|
|
12
|
+
*
|
|
13
|
+
* A strategy applies wherever frames decode through this seam: the live scrub
|
|
14
|
+
* surface and the analysis / extraction path alike. AnalysisSession decodes at
|
|
15
|
+
* whatever strategy it is given (native when omitted), so a thumbnail pass can
|
|
16
|
+
* cache a small blit instead of a native-size one.
|
|
17
|
+
*/
|
|
18
|
+
/** Decode at native resolution. The conservative default. */
|
|
19
|
+
function nativeResolution() {
|
|
20
|
+
return { kind: "native" };
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Decode at the on-screen size: canvas CSS width times devicePixelRatio. Best
|
|
24
|
+
* for fixed-size surfaces fed by a much larger source (frame sampler, inline
|
|
25
|
+
* players). Falls back to native while the box is unmeasured.
|
|
26
|
+
*
|
|
27
|
+
* The box it reads is the one bindCanvas measures, so this strategy resolves to
|
|
28
|
+
* native under presentation "frames", where the engine holds no canvas and
|
|
29
|
+
* nothing ever measures one. A frames-mode consumer passes displayBoxResolution
|
|
30
|
+
* instead.
|
|
31
|
+
*/
|
|
32
|
+
function viewportResolution(options = {}) {
|
|
33
|
+
return {
|
|
34
|
+
kind: "viewport",
|
|
35
|
+
maxDevicePixelRatio: options.maxDevicePixelRatio ?? 2,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Decode at no more than maxWidth regardless of display size. For consumers
|
|
40
|
+
* with a hard throughput or memory ceiling (batch surfaces, thumbnail farms).
|
|
41
|
+
*/
|
|
42
|
+
function cappedResolution(maxWidth) {
|
|
43
|
+
return { kind: "capped", maxWidth };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Decode at the size the frame will actually occupy inside a box the consumer
|
|
47
|
+
* describes: native aspect fitted into boxWidth x boxHeight, times the clamped
|
|
48
|
+
* device pixel ratio. Letterboxing is why the box is two numbers and not one,
|
|
49
|
+
* since a portrait source in a landscape box paints far narrower than the box.
|
|
50
|
+
*
|
|
51
|
+
* This is the strategy for presentation "frames". There the consumer owns the
|
|
52
|
+
* compositor, so it is the only side that knows the box, and viewportResolution
|
|
53
|
+
* has nothing to read.
|
|
54
|
+
*/
|
|
55
|
+
function displayBoxResolution(options) {
|
|
56
|
+
return {
|
|
57
|
+
kind: "displayBox",
|
|
58
|
+
boxWidth: options.boxWidth,
|
|
59
|
+
boxHeight: options.boxHeight,
|
|
60
|
+
devicePixelRatio: options.devicePixelRatio,
|
|
61
|
+
maxDevicePixelRatio: options.maxDevicePixelRatio ?? 2,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** Runs the descriptor against a context to produce a target decode width. */
|
|
65
|
+
function strategyWidth(strategy, ctx) {
|
|
66
|
+
switch (strategy.kind) {
|
|
67
|
+
case "native":
|
|
68
|
+
return ctx.nativeWidth;
|
|
69
|
+
case "viewport": {
|
|
70
|
+
if (ctx.displayWidth === null || ctx.displayWidth <= 0)
|
|
71
|
+
return ctx.nativeWidth;
|
|
72
|
+
const dpr = clampDpr(ctx.devicePixelRatio, strategy.maxDevicePixelRatio);
|
|
73
|
+
return Math.ceil(ctx.displayWidth * dpr);
|
|
74
|
+
}
|
|
75
|
+
case "capped":
|
|
76
|
+
return Math.min(strategy.maxWidth, ctx.nativeWidth);
|
|
77
|
+
case "displayBox": {
|
|
78
|
+
const { boxWidth, boxHeight } = strategy;
|
|
79
|
+
if (!(boxWidth > 0) || !(boxHeight > 0))
|
|
80
|
+
return ctx.nativeWidth;
|
|
81
|
+
const fit = Math.min(boxWidth / ctx.nativeWidth, boxHeight / ctx.nativeHeight);
|
|
82
|
+
const dpr = clampDpr(strategy.devicePixelRatio, strategy.maxDevicePixelRatio);
|
|
83
|
+
return Math.ceil(ctx.nativeWidth * fit * dpr);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Runs a strategy and returns native-bounded, aspect-preserving integer
|
|
89
|
+
* dimensions safe to hand to CanvasSink and to size a canvas backing store.
|
|
90
|
+
* A strategy that returns garbage (non-finite, non-positive) falls back to
|
|
91
|
+
* native rather than producing a broken surface.
|
|
92
|
+
*/
|
|
93
|
+
function resolveDecodeDimensions(strategy, ctx) {
|
|
94
|
+
const nativeWidth = Math.max(1, Math.round(ctx.nativeWidth));
|
|
95
|
+
const nativeHeight = Math.max(1, Math.round(ctx.nativeHeight));
|
|
96
|
+
const raw = strategyWidth(strategy, ctx);
|
|
97
|
+
const width = Number.isFinite(raw) && raw > 0
|
|
98
|
+
? Math.min(Math.round(raw), nativeWidth)
|
|
99
|
+
: nativeWidth;
|
|
100
|
+
const height = Math.max(1, Math.round((width * nativeHeight) / nativeWidth));
|
|
101
|
+
return { width, height };
|
|
102
|
+
}
|
|
103
|
+
function clampDpr(dpr, maxDpr) {
|
|
104
|
+
if (!Number.isFinite(dpr) || dpr <= 0)
|
|
105
|
+
return 1;
|
|
106
|
+
return Math.min(dpr, maxDpr);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { cappedResolution as c, displayBoxResolution as d, nativeResolution as n, resolveDecodeDimensions as r, viewportResolution as v };
|
|
@@ -324,6 +324,7 @@ export declare class DecodeScheduler implements ScrubCursor {
|
|
|
324
324
|
private runPrefetch;
|
|
325
325
|
private runExactWindow;
|
|
326
326
|
private runPreviewSweep;
|
|
327
|
+
private residentPreviewAt;
|
|
327
328
|
private decodeInto;
|
|
328
329
|
/**
|
|
329
330
|
* One sweep pull, ended by abandonment rather than by the decode it is
|
|
@@ -211,8 +211,10 @@ export declare class EngineCore {
|
|
|
211
211
|
*
|
|
212
212
|
* An exact walk answers at or before the frame it aimed at, and no further
|
|
213
213
|
* back than the sample next to it, so the target falls inside the answering
|
|
214
|
-
* frame's own span. That span is the
|
|
215
|
-
*
|
|
214
|
+
* frame's own span. That span is the test: a frame decoded for some earlier
|
|
215
|
+
* position sits outside it however recently it was painted. The aimed-at
|
|
216
|
+
* frame answers without it, because a track's last frame has an empty span
|
|
217
|
+
* when its file states no duration for it.
|
|
216
218
|
*/
|
|
217
219
|
private answersAwaitedSeek;
|
|
218
220
|
/** The frame table of the loaded source. Reached only from paths that have
|