@eyepop.ai/eyepop 3.17.3 → 3.19.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.
@@ -69,7 +69,9 @@ interface Prediction extends StreamTime {
69
69
  meshs?: Array<PredictedMesh>;
70
70
  keyPoints?: Array<PredictedKeyPoints>;
71
71
  embeddings?: Array<PredictedEmbedding>;
72
+ details?: Array<Map<string, any>>;
72
73
  motions?: Array<PredictedMotion>;
74
+ depth?: Depth;
73
75
  }
74
76
  interface PredictedClass {
75
77
  id?: number;
@@ -99,6 +101,24 @@ interface Mask {
99
101
  height: number;
100
102
  stride: number;
101
103
  }
104
+ /**
105
+ * A frame-level depth map as produced by depth estimation abilities
106
+ * (e.g. eyepop.depth.*).
107
+ *
108
+ * `values` is the base64 encoding of width*height little-endian float32
109
+ * values in row-major order. The map always has the aspect ratio of the
110
+ * source frame; map a source coordinate (x, y) to the map proportionally:
111
+ * (x * width / source_width, y * height / source_height).
112
+ *
113
+ * Values are canonical metric depth (multiply by the camera's focal length
114
+ * in pixels and divide by 300 for meters). Sky pixels carry +Infinity.
115
+ * Use decodeDepthMap() to access the values.
116
+ */
117
+ interface Depth {
118
+ width: number;
119
+ height: number;
120
+ values: string;
121
+ }
102
122
  interface PredictedObject extends PredictedClass {
103
123
  trackId?: number;
104
124
  x: number;
@@ -114,6 +134,7 @@ interface PredictedObject extends PredictedClass {
114
134
  texts?: Array<PredictedText>;
115
135
  meshs?: Array<PredictedMesh>;
116
136
  keyPoints?: Array<PredictedKeyPoints>;
137
+ details?: Array<Map<string, any>>;
117
138
  }
118
139
  interface Point2d {
119
140
  x: number;
@@ -1318,6 +1339,40 @@ declare class DataEndpoint extends Endpoint<DataEndpoint> {
1318
1339
  resolveAliases(aliases: string[]): Promise<AliasResolution[]>;
1319
1340
  }
1320
1341
 
1342
+ /**
1343
+ * A decoded frame-level depth map.
1344
+ *
1345
+ * Values are canonical metric depth in row-major order; sky pixels are +Infinity.
1346
+ * See decodeDepthMap().
1347
+ */
1348
+ declare class DepthMap {
1349
+ readonly width: number;
1350
+ readonly height: number;
1351
+ readonly values: Float32Array;
1352
+ private _finiteMin;
1353
+ private _finiteMax;
1354
+ constructor(width: number, height: number, values: Float32Array);
1355
+ /**
1356
+ * The depth value at map pixel (x, y), or - when sourceWidth/sourceHeight
1357
+ * are given - at source frame coordinate (x, y) mapped proportionally.
1358
+ * Returns +Infinity for sky pixels.
1359
+ */
1360
+ at(x: number, y: number, sourceWidth?: number, sourceHeight?: number): number;
1361
+ isSky(x: number, y: number, sourceWidth?: number, sourceHeight?: number): boolean;
1362
+ /** The smallest finite depth value, or undefined if the whole map is sky. */
1363
+ get finiteMin(): number | undefined;
1364
+ /** The largest finite depth value, or undefined if the whole map is sky. */
1365
+ get finiteMax(): number | undefined;
1366
+ private computeFiniteRange;
1367
+ }
1368
+ /**
1369
+ * Decode a Prediction's `depth` member into a DepthMap.
1370
+ *
1371
+ * The wire format is base64 of width*height little-endian float32 values in
1372
+ * row-major order; sky pixels are +Infinity.
1373
+ */
1374
+ declare function decodeDepthMap(depth: Depth): DepthMap;
1375
+
1321
1376
  type Bytes = string | ArrayBuffer | Uint8Array | Buffer | null | undefined;
1322
1377
  interface StreamEvent {
1323
1378
  type: string;
@@ -1496,4 +1551,4 @@ declare namespace EyePop {
1496
1551
  function dataEndpoint(opts?: DataOptions): DataEndpoint;
1497
1552
  }
1498
1553
 
1499
- export { type AbilityAliasEntry, AbstractJob, type AccessTokenAuth, type AliasResolution, type Annotation, AnnotationInclusionMode, AnnotationType, type ApiKeyAuth, type Area, AreaType, ArtifactType, type Asset, type AssetImport, AssetInclusionMode, AssetStatus, AssetUrlType, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotate, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateStatus, AutoAnnotateTask, type AutoPromptConfig, type AutoTask, type BaseArea, type BaseComponent, type BaseTask, type Box, type ChangeEvent, ChangeType, type ClassificationTask, type ComponentFinderComponent, type ComponentParams, type Contour, type ContourArea, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DEFAULT_PREDICTION_VERSION, DataApiType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetAutoAnnotate, type DatasetAutoAnnotateCreate, type DatasetAutoAnnotateUpdate, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, type DownloadResponse, Endpoint, EndpointState, type EvaluateConfig, type EvaluateFilter, type EvaluateRequest, type EvaluateResponse, type EvaluateRunInfo, EvaluationStatus, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferRequest, type InferRunInfo, type InferRuntimeConfig, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromGroupJob, LoadFromJob, LoadMediaStreamJob, type LocalAuth, type Mask, type MediaStreamSource, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type MotionDetectConfig, MotionModel, type MultipartContent, type MultipartPart, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type PlatformSupport, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedEmbedding, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedMotion, type PredictedObject, type PredictedText, type Prediction, PredictionVersion, type ProcessParams, type ProcessRequest, type QcAiHubExportParams, type RectangleArea, type ResultStream, type Roi, Semaphore, type Session, type SessionAuth, type Source, Stream, type StreamEvent, type StreamSource, type StreamTime, TaskMode, TaskType, type TimeSpan, type TrackingComponent, TranscodeMode, type TransformInto, TransientPopId, UploadGroupJob, UploadJob, type UploadSource, type UrlSource, UserReview, VideoMode, type VlmAbility, type VlmAbilityCreate, type VlmAbilityGroup, type VlmAbilityGroupCreate, type VlmAbilityGroupUpdate, VlmAbilityStatus, type VlmAbilityUpdate, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, type Workflow, WorkflowPhase, accessTokenCredential, apiKeyCredential, EyePop as default, encodeMultipartFormData, getBaseUrl, randomMultipartBoundary, readableStreamFromString, resolveAuth };
1554
+ export { type AbilityAliasEntry, AbstractJob, type AccessTokenAuth, type AliasResolution, type Annotation, AnnotationInclusionMode, AnnotationType, type ApiKeyAuth, type Area, AreaType, ArtifactType, type Asset, type AssetImport, AssetInclusionMode, AssetStatus, AssetUrlType, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotate, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateStatus, AutoAnnotateTask, type AutoPromptConfig, type AutoTask, type BaseArea, type BaseComponent, type BaseTask, type Box, type ChangeEvent, ChangeType, type ClassificationTask, type ComponentFinderComponent, type ComponentParams, type Contour, type ContourArea, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DEFAULT_PREDICTION_VERSION, DataApiType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetAutoAnnotate, type DatasetAutoAnnotateCreate, type DatasetAutoAnnotateUpdate, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, type Depth, DepthMap, type DownloadResponse, Endpoint, EndpointState, type EvaluateConfig, type EvaluateFilter, type EvaluateRequest, type EvaluateResponse, type EvaluateRunInfo, EvaluationStatus, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferRequest, type InferRunInfo, type InferRuntimeConfig, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromGroupJob, LoadFromJob, LoadMediaStreamJob, type LocalAuth, type Mask, type MediaStreamSource, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type MotionDetectConfig, MotionModel, type MultipartContent, type MultipartPart, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type PlatformSupport, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedEmbedding, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedMotion, type PredictedObject, type PredictedText, type Prediction, PredictionVersion, type ProcessParams, type ProcessRequest, type QcAiHubExportParams, type RectangleArea, type ResultStream, type Roi, Semaphore, type Session, type SessionAuth, type Source, Stream, type StreamEvent, type StreamSource, type StreamTime, TaskMode, TaskType, type TimeSpan, type TrackingComponent, TranscodeMode, type TransformInto, TransientPopId, UploadGroupJob, UploadJob, type UploadSource, type UrlSource, UserReview, VideoMode, type VlmAbility, type VlmAbilityCreate, type VlmAbilityGroup, type VlmAbilityGroupCreate, type VlmAbilityGroupUpdate, VlmAbilityStatus, type VlmAbilityUpdate, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, type Workflow, WorkflowPhase, accessTokenCredential, apiKeyCredential, decodeDepthMap, EyePop as default, encodeMultipartFormData, getBaseUrl, randomMultipartBoundary, readableStreamFromString, resolveAuth };
@@ -69,7 +69,9 @@ interface Prediction extends StreamTime {
69
69
  meshs?: Array<PredictedMesh>;
70
70
  keyPoints?: Array<PredictedKeyPoints>;
71
71
  embeddings?: Array<PredictedEmbedding>;
72
+ details?: Array<Map<string, any>>;
72
73
  motions?: Array<PredictedMotion>;
74
+ depth?: Depth;
73
75
  }
74
76
  interface PredictedClass {
75
77
  id?: number;
@@ -99,6 +101,24 @@ interface Mask {
99
101
  height: number;
100
102
  stride: number;
101
103
  }
104
+ /**
105
+ * A frame-level depth map as produced by depth estimation abilities
106
+ * (e.g. eyepop.depth.*).
107
+ *
108
+ * `values` is the base64 encoding of width*height little-endian float32
109
+ * values in row-major order. The map always has the aspect ratio of the
110
+ * source frame; map a source coordinate (x, y) to the map proportionally:
111
+ * (x * width / source_width, y * height / source_height).
112
+ *
113
+ * Values are canonical metric depth (multiply by the camera's focal length
114
+ * in pixels and divide by 300 for meters). Sky pixels carry +Infinity.
115
+ * Use decodeDepthMap() to access the values.
116
+ */
117
+ interface Depth {
118
+ width: number;
119
+ height: number;
120
+ values: string;
121
+ }
102
122
  interface PredictedObject extends PredictedClass {
103
123
  trackId?: number;
104
124
  x: number;
@@ -114,6 +134,7 @@ interface PredictedObject extends PredictedClass {
114
134
  texts?: Array<PredictedText>;
115
135
  meshs?: Array<PredictedMesh>;
116
136
  keyPoints?: Array<PredictedKeyPoints>;
137
+ details?: Array<Map<string, any>>;
117
138
  }
118
139
  interface Point2d {
119
140
  x: number;
@@ -1318,6 +1339,40 @@ declare class DataEndpoint extends Endpoint<DataEndpoint> {
1318
1339
  resolveAliases(aliases: string[]): Promise<AliasResolution[]>;
1319
1340
  }
1320
1341
 
1342
+ /**
1343
+ * A decoded frame-level depth map.
1344
+ *
1345
+ * Values are canonical metric depth in row-major order; sky pixels are +Infinity.
1346
+ * See decodeDepthMap().
1347
+ */
1348
+ declare class DepthMap {
1349
+ readonly width: number;
1350
+ readonly height: number;
1351
+ readonly values: Float32Array;
1352
+ private _finiteMin;
1353
+ private _finiteMax;
1354
+ constructor(width: number, height: number, values: Float32Array);
1355
+ /**
1356
+ * The depth value at map pixel (x, y), or - when sourceWidth/sourceHeight
1357
+ * are given - at source frame coordinate (x, y) mapped proportionally.
1358
+ * Returns +Infinity for sky pixels.
1359
+ */
1360
+ at(x: number, y: number, sourceWidth?: number, sourceHeight?: number): number;
1361
+ isSky(x: number, y: number, sourceWidth?: number, sourceHeight?: number): boolean;
1362
+ /** The smallest finite depth value, or undefined if the whole map is sky. */
1363
+ get finiteMin(): number | undefined;
1364
+ /** The largest finite depth value, or undefined if the whole map is sky. */
1365
+ get finiteMax(): number | undefined;
1366
+ private computeFiniteRange;
1367
+ }
1368
+ /**
1369
+ * Decode a Prediction's `depth` member into a DepthMap.
1370
+ *
1371
+ * The wire format is base64 of width*height little-endian float32 values in
1372
+ * row-major order; sky pixels are +Infinity.
1373
+ */
1374
+ declare function decodeDepthMap(depth: Depth): DepthMap;
1375
+
1321
1376
  type Bytes = string | ArrayBuffer | Uint8Array | Buffer | null | undefined;
1322
1377
  interface StreamEvent {
1323
1378
  type: string;
@@ -1496,4 +1551,4 @@ declare namespace EyePop {
1496
1551
  function dataEndpoint(opts?: DataOptions): DataEndpoint;
1497
1552
  }
1498
1553
 
1499
- export { type AbilityAliasEntry, AbstractJob, type AccessTokenAuth, type AliasResolution, type Annotation, AnnotationInclusionMode, AnnotationType, type ApiKeyAuth, type Area, AreaType, ArtifactType, type Asset, type AssetImport, AssetInclusionMode, AssetStatus, AssetUrlType, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotate, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateStatus, AutoAnnotateTask, type AutoPromptConfig, type AutoTask, type BaseArea, type BaseComponent, type BaseTask, type Box, type ChangeEvent, ChangeType, type ClassificationTask, type ComponentFinderComponent, type ComponentParams, type Contour, type ContourArea, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DEFAULT_PREDICTION_VERSION, DataApiType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetAutoAnnotate, type DatasetAutoAnnotateCreate, type DatasetAutoAnnotateUpdate, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, type DownloadResponse, Endpoint, EndpointState, type EvaluateConfig, type EvaluateFilter, type EvaluateRequest, type EvaluateResponse, type EvaluateRunInfo, EvaluationStatus, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferRequest, type InferRunInfo, type InferRuntimeConfig, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromGroupJob, LoadFromJob, LoadMediaStreamJob, type LocalAuth, type Mask, type MediaStreamSource, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type MotionDetectConfig, MotionModel, type MultipartContent, type MultipartPart, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type PlatformSupport, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedEmbedding, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedMotion, type PredictedObject, type PredictedText, type Prediction, PredictionVersion, type ProcessParams, type ProcessRequest, type QcAiHubExportParams, type RectangleArea, type ResultStream, type Roi, Semaphore, type Session, type SessionAuth, type Source, Stream, type StreamEvent, type StreamSource, type StreamTime, TaskMode, TaskType, type TimeSpan, type TrackingComponent, TranscodeMode, type TransformInto, TransientPopId, UploadGroupJob, UploadJob, type UploadSource, type UrlSource, UserReview, VideoMode, type VlmAbility, type VlmAbilityCreate, type VlmAbilityGroup, type VlmAbilityGroupCreate, type VlmAbilityGroupUpdate, VlmAbilityStatus, type VlmAbilityUpdate, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, type Workflow, WorkflowPhase, accessTokenCredential, apiKeyCredential, EyePop as default, encodeMultipartFormData, getBaseUrl, randomMultipartBoundary, readableStreamFromString, resolveAuth };
1554
+ export { type AbilityAliasEntry, AbstractJob, type AccessTokenAuth, type AliasResolution, type Annotation, AnnotationInclusionMode, AnnotationType, type ApiKeyAuth, type Area, AreaType, ArtifactType, type Asset, type AssetImport, AssetInclusionMode, AssetStatus, AssetUrlType, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotate, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateStatus, AutoAnnotateTask, type AutoPromptConfig, type AutoTask, type BaseArea, type BaseComponent, type BaseTask, type Box, type ChangeEvent, ChangeType, type ClassificationTask, type ComponentFinderComponent, type ComponentParams, type Contour, type ContourArea, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DEFAULT_PREDICTION_VERSION, DataApiType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetAutoAnnotate, type DatasetAutoAnnotateCreate, type DatasetAutoAnnotateUpdate, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, type Depth, DepthMap, type DownloadResponse, Endpoint, EndpointState, type EvaluateConfig, type EvaluateFilter, type EvaluateRequest, type EvaluateResponse, type EvaluateRunInfo, EvaluationStatus, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferRequest, type InferRunInfo, type InferRuntimeConfig, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromGroupJob, LoadFromJob, LoadMediaStreamJob, type LocalAuth, type Mask, type MediaStreamSource, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type MotionDetectConfig, MotionModel, type MultipartContent, type MultipartPart, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type PlatformSupport, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedEmbedding, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedMotion, type PredictedObject, type PredictedText, type Prediction, PredictionVersion, type ProcessParams, type ProcessRequest, type QcAiHubExportParams, type RectangleArea, type ResultStream, type Roi, Semaphore, type Session, type SessionAuth, type Source, Stream, type StreamEvent, type StreamSource, type StreamTime, TaskMode, TaskType, type TimeSpan, type TrackingComponent, TranscodeMode, type TransformInto, TransientPopId, UploadGroupJob, UploadJob, type UploadSource, type UrlSource, UserReview, VideoMode, type VlmAbility, type VlmAbilityCreate, type VlmAbilityGroup, type VlmAbilityGroupCreate, type VlmAbilityGroupUpdate, VlmAbilityStatus, type VlmAbilityUpdate, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, type Workflow, WorkflowPhase, accessTokenCredential, apiKeyCredential, decodeDepthMap, EyePop as default, encodeMultipartFormData, getBaseUrl, randomMultipartBoundary, readableStreamFromString, resolveAuth };
@@ -8671,6 +8671,7 @@ __export(index_exports, {
8671
8671
  DEFAULT_PREDICTION_VERSION: () => DEFAULT_PREDICTION_VERSION,
8672
8672
  DataApiType: () => DataApiType,
8673
8673
  DataEndpoint: () => DataEndpoint,
8674
+ DepthMap: () => DepthMap,
8674
8675
  Endpoint: () => Endpoint,
8675
8676
  EndpointState: () => EndpointState,
8676
8677
  EvaluationStatus: () => EvaluationStatus,
@@ -8711,6 +8712,7 @@ __export(index_exports, {
8711
8712
  WorkflowPhase: () => WorkflowPhase,
8712
8713
  accessTokenCredential: () => accessTokenCredential,
8713
8714
  apiKeyCredential: () => apiKeyCredential,
8715
+ decodeDepthMap: () => decodeDepthMap,
8714
8716
  default: () => index_default,
8715
8717
  encodeMultipartFormData: () => encodeMultipartFormData,
8716
8718
  getBaseUrl: () => getBaseUrl,
@@ -12757,6 +12759,97 @@ var DataEndpoint = class extends Endpoint {
12757
12759
  }
12758
12760
  };
12759
12761
 
12762
+ // depth.ts
12763
+ var isLittleEndianPlatform = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
12764
+ function base64ToBytes(base64) {
12765
+ if (typeof Buffer !== "undefined") {
12766
+ const buffer = Buffer.from(base64, "base64");
12767
+ return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
12768
+ }
12769
+ const binary = atob(base64);
12770
+ const bytes = new Uint8Array(binary.length);
12771
+ for (let i = 0; i < binary.length; i++) {
12772
+ bytes[i] = binary.charCodeAt(i);
12773
+ }
12774
+ return bytes;
12775
+ }
12776
+ var DepthMap = class {
12777
+ constructor(width, height, values) {
12778
+ this.width = width;
12779
+ this.height = height;
12780
+ this.values = values;
12781
+ }
12782
+ /**
12783
+ * The depth value at map pixel (x, y), or - when sourceWidth/sourceHeight
12784
+ * are given - at source frame coordinate (x, y) mapped proportionally.
12785
+ * Returns +Infinity for sky pixels.
12786
+ */
12787
+ at(x, y, sourceWidth, sourceHeight) {
12788
+ let mapX = x;
12789
+ let mapY = y;
12790
+ if (sourceWidth && sourceHeight) {
12791
+ mapX = x * this.width / sourceWidth;
12792
+ mapY = y * this.height / sourceHeight;
12793
+ }
12794
+ const clampedX = Math.min(Math.max(Math.floor(mapX), 0), this.width - 1);
12795
+ const clampedY = Math.min(Math.max(Math.floor(mapY), 0), this.height - 1);
12796
+ return this.values[clampedY * this.width + clampedX];
12797
+ }
12798
+ isSky(x, y, sourceWidth, sourceHeight) {
12799
+ return this.at(x, y, sourceWidth, sourceHeight) === Number.POSITIVE_INFINITY;
12800
+ }
12801
+ /** The smallest finite depth value, or undefined if the whole map is sky. */
12802
+ get finiteMin() {
12803
+ this.computeFiniteRange();
12804
+ return this._finiteMin;
12805
+ }
12806
+ /** The largest finite depth value, or undefined if the whole map is sky. */
12807
+ get finiteMax() {
12808
+ this.computeFiniteRange();
12809
+ return this._finiteMax;
12810
+ }
12811
+ computeFiniteRange() {
12812
+ if (this._finiteMin !== void 0 || this._finiteMax !== void 0) {
12813
+ return;
12814
+ }
12815
+ let min = Number.POSITIVE_INFINITY;
12816
+ let max = Number.NEGATIVE_INFINITY;
12817
+ for (let i = 0; i < this.values.length; i++) {
12818
+ const value = this.values[i];
12819
+ if (Number.isFinite(value)) {
12820
+ if (value < min) min = value;
12821
+ if (value > max) max = value;
12822
+ }
12823
+ }
12824
+ if (max >= min) {
12825
+ this._finiteMin = min;
12826
+ this._finiteMax = max;
12827
+ }
12828
+ }
12829
+ };
12830
+ function decodeDepthMap(depth) {
12831
+ if (!Number.isSafeInteger(depth.width) || depth.width <= 0 || !Number.isSafeInteger(depth.height) || depth.height <= 0 || !Number.isSafeInteger(depth.width * depth.height * 4)) {
12832
+ throw new Error(`invalid depth dimensions: ${depth.width}x${depth.height}`);
12833
+ }
12834
+ const bytes = base64ToBytes(depth.values);
12835
+ const count = depth.width * depth.height;
12836
+ if (bytes.byteLength !== count * 4) {
12837
+ throw new Error(`depth values hold ${bytes.byteLength} bytes, expected ${count * 4} for ${depth.width}x${depth.height} float32`);
12838
+ }
12839
+ let values;
12840
+ if (isLittleEndianPlatform) {
12841
+ const aligned = new Uint8Array(bytes);
12842
+ values = new Float32Array(aligned.buffer, 0, count);
12843
+ } else {
12844
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
12845
+ values = new Float32Array(count);
12846
+ for (let i = 0; i < count; i++) {
12847
+ values[i] = view.getFloat32(i * 4, true);
12848
+ }
12849
+ }
12850
+ return new DepthMap(depth.width, depth.height, values);
12851
+ }
12852
+
12760
12853
  // worker/webrtc_whep.ts
12761
12854
  var WebrtcWhep = class extends WebrtcBase {
12762
12855
  constructor(ingressId, getSession, client, requestLogger) {
@@ -12991,6 +13084,7 @@ var index_default = EyePop;
12991
13084
  DEFAULT_PREDICTION_VERSION,
12992
13085
  DataApiType,
12993
13086
  DataEndpoint,
13087
+ DepthMap,
12994
13088
  Endpoint,
12995
13089
  EndpointState,
12996
13090
  EvaluationStatus,
@@ -13031,6 +13125,7 @@ var index_default = EyePop;
13031
13125
  WorkflowPhase,
13032
13126
  accessTokenCredential,
13033
13127
  apiKeyCredential,
13128
+ decodeDepthMap,
13034
13129
  encodeMultipartFormData,
13035
13130
  getBaseUrl,
13036
13131
  randomMultipartBoundary,