@eyepop.ai/eyepop 3.19.0 → 3.20.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/README.md +1 -1
- package/dist/eyepop.index.d.mts +376 -4
- package/dist/eyepop.index.d.ts +376 -4
- package/dist/eyepop.index.js +433 -91
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +423 -90
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
package/dist/eyepop.index.d.mts
CHANGED
|
@@ -95,11 +95,20 @@ interface Contour {
|
|
|
95
95
|
points: Array<Point2d>;
|
|
96
96
|
cutouts: Array<Array<Point2d>>;
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* A segmentation mask, optionally with a per-object point cloud.
|
|
100
|
+
*
|
|
101
|
+
* `world` is the base64 encoding of three little-endian float32 values per mask
|
|
102
|
+
* pixel, row-major, exactly width*height triples - so the point for bitmap
|
|
103
|
+
* pixel (i, j) is at triple index j * width + i. Points the worker could not
|
|
104
|
+
* place are NaN. Use decodePointCloud() to read it.
|
|
105
|
+
*/
|
|
98
106
|
interface Mask {
|
|
99
107
|
bitmap: string;
|
|
100
108
|
width: number;
|
|
101
109
|
height: number;
|
|
102
110
|
stride: number;
|
|
111
|
+
world?: string;
|
|
103
112
|
}
|
|
104
113
|
/**
|
|
105
114
|
* A frame-level depth map as produced by depth estimation abilities
|
|
@@ -110,15 +119,35 @@ interface Mask {
|
|
|
110
119
|
* source frame; map a source coordinate (x, y) to the map proportionally:
|
|
111
120
|
* (x * width / source_width, y * height / source_height).
|
|
112
121
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
122
|
+
* Sky pixels carry +Infinity. Use decodeDepthMap() to access the values.
|
|
123
|
+
*
|
|
124
|
+
* `semantic` says what the values mean, and is always present in prediction v2 -
|
|
125
|
+
* "unknown" included - so an absent member means a worker that predates the
|
|
126
|
+
* field rather than a map that declined to say:
|
|
127
|
+
*
|
|
128
|
+
* - "canonical_metric" - metres = value * focal_px / 300, with focal_px scaled
|
|
129
|
+
* to the map's own resolution
|
|
130
|
+
* - "metric" - the value is already metres
|
|
131
|
+
* - "relative" - scale- AND shift-invariant, so ordering is meaningful but
|
|
132
|
+
* distance is not. Not back-projectable: recovering a cloud from it yields a
|
|
133
|
+
* distorted scene rather than a scaled one
|
|
134
|
+
* - "unknown" - the ability declared nothing. Not back-projectable
|
|
135
|
+
*
|
|
136
|
+
* `world` is the scene point cloud, present when the Pop asked for
|
|
137
|
+
* `depthMap.toWorld`. Same encoding as `Mask.world` - three little-endian
|
|
138
|
+
* float32 per pixel, row-major - but on this map's own grid, so the point for
|
|
139
|
+
* pixel (i, j) is at triple index j * width + i, exactly where that pixel's
|
|
140
|
+
* value sits in `values`. Points the worker could not place are NaN; the value
|
|
141
|
+
* at the same index is what says why, which is why both are sent.
|
|
116
142
|
*/
|
|
117
143
|
interface Depth {
|
|
118
144
|
width: number;
|
|
119
145
|
height: number;
|
|
120
146
|
values: string;
|
|
147
|
+
semantic?: DepthSemantic;
|
|
148
|
+
world?: string;
|
|
121
149
|
}
|
|
150
|
+
type DepthSemantic = 'canonical_metric' | 'metric' | 'relative' | 'unknown';
|
|
122
151
|
interface PredictedObject extends PredictedClass {
|
|
123
152
|
trackId?: number;
|
|
124
153
|
x: number;
|
|
@@ -136,9 +165,29 @@ interface PredictedObject extends PredictedClass {
|
|
|
136
165
|
keyPoints?: Array<PredictedKeyPoints>;
|
|
137
166
|
details?: Array<Map<string, any>>;
|
|
138
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* A point in source pixels, optionally placed in 3D.
|
|
170
|
+
*
|
|
171
|
+
* `worldX`/`worldY`/`worldZ` are metres, present only when the pipeline was
|
|
172
|
+
* asked for world coordinates - a Pop with `depthMap` and a component with
|
|
173
|
+
* `toWorld` - and only in prediction v2. A point the worker could not place -
|
|
174
|
+
* sky, outside the depth map, no usable map - carries none of the three rather
|
|
175
|
+
* than a zero or a NaN, so test for undefined.
|
|
176
|
+
*
|
|
177
|
+
* Which frame they are in depends on the source's camera: with extrinsics, the
|
|
178
|
+
* world frame those define (Z up, ground at Z = 0); without them, the camera
|
|
179
|
+
* frame in the OpenCV convention (X right, Y down, Z forward from the camera).
|
|
180
|
+
*
|
|
181
|
+
* Only the carriers the worker enriches ever populate them: key points, outline
|
|
182
|
+
* points and contour points. Bounding boxes and mesh points do not - a box is
|
|
183
|
+
* not a point, and any single anchor choice would be arbitrary.
|
|
184
|
+
*/
|
|
139
185
|
interface Point2d {
|
|
140
186
|
x: number;
|
|
141
187
|
y: number;
|
|
188
|
+
worldX?: number;
|
|
189
|
+
worldY?: number;
|
|
190
|
+
worldZ?: number;
|
|
142
191
|
}
|
|
143
192
|
interface PredictedMesh {
|
|
144
193
|
category?: string;
|
|
@@ -750,6 +799,111 @@ interface AliasResolution {
|
|
|
750
799
|
model_uuid: string | null;
|
|
751
800
|
}
|
|
752
801
|
|
|
802
|
+
/**
|
|
803
|
+
* Camera calibration for a source, as accepted by the worker's setSource.
|
|
804
|
+
*
|
|
805
|
+
* A calibration is what turns a depth map into measurable world coordinates.
|
|
806
|
+
* Without one the worker falls back to an assumed horizontal field of view,
|
|
807
|
+
* which is a development scaffold rather than something to ship: for canonical
|
|
808
|
+
* metric depth the guess cancels out of X and Y and survives only in Z, so
|
|
809
|
+
* lateral measurements stay exact while every distance along the optical axis
|
|
810
|
+
* is wrong by however wrong the guess was.
|
|
811
|
+
*
|
|
812
|
+
* Mirrors what the instance API accepts. validateCamera() checks it locally so
|
|
813
|
+
* a bad calibration is an error here rather than a 400 halfway through an
|
|
814
|
+
* upload; the worker validates authoritatively, and the two are meant to agree.
|
|
815
|
+
*/
|
|
816
|
+
/**
|
|
817
|
+
* How far a rotation's norm may sit from 1 and still be taken for a rotation.
|
|
818
|
+
* Loose enough to survive a float round trip through JSON, tight enough to
|
|
819
|
+
* catch an un-normalised or garbage one. Matches the instance and the worker.
|
|
820
|
+
*/
|
|
821
|
+
declare const QUATERNION_TOLERANCE = 0.001;
|
|
822
|
+
/**
|
|
823
|
+
* The pinhole parameters, normalised to the frame rather than given in pixels.
|
|
824
|
+
*
|
|
825
|
+
* Normalised so one calibration survives a resolution change: a camera
|
|
826
|
+
* calibrated at 1920x1080 and later streamed at 1280x720 keeps working. Pixel
|
|
827
|
+
* values carrying no calibration resolution are wrong by exactly the resolution
|
|
828
|
+
* ratio, and nothing downstream can detect it.
|
|
829
|
+
*
|
|
830
|
+
* `fx`/`fy` are the focal length as a fraction of the frame's width and height;
|
|
831
|
+
* `cx`/`cy` are the principal point in the same normalisation.
|
|
832
|
+
*/
|
|
833
|
+
interface CameraIntrinsics {
|
|
834
|
+
fx: number;
|
|
835
|
+
fy: number;
|
|
836
|
+
cx: number;
|
|
837
|
+
cy: number;
|
|
838
|
+
}
|
|
839
|
+
/** The OpenCV Brown-Conrady coefficients. All zero is a rectilinear lens. */
|
|
840
|
+
interface CameraDistortion {
|
|
841
|
+
k1?: number;
|
|
842
|
+
k2?: number;
|
|
843
|
+
p1?: number;
|
|
844
|
+
p2?: number;
|
|
845
|
+
k3?: number;
|
|
846
|
+
}
|
|
847
|
+
/** A rotation, w first. Must be a unit quaternion. */
|
|
848
|
+
interface Quaternion {
|
|
849
|
+
w: number;
|
|
850
|
+
x: number;
|
|
851
|
+
y: number;
|
|
852
|
+
z: number;
|
|
853
|
+
}
|
|
854
|
+
/** A translation in metres. */
|
|
855
|
+
interface Vector3d {
|
|
856
|
+
x: number;
|
|
857
|
+
y: number;
|
|
858
|
+
z: number;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* The camera's pose, expressed camera -> world.
|
|
862
|
+
*
|
|
863
|
+
* As `P_world = R(rotation) * P_camera + translation`, so the rotation carries
|
|
864
|
+
* the camera's axes onto the world's and the translation is where the camera
|
|
865
|
+
* itself sits. The world frame is Z up with the ground plane at Z = 0.
|
|
866
|
+
*
|
|
867
|
+
* This is the inverse of what cv2.solvePnP returns; a caller holding its
|
|
868
|
+
* rvec/tvec must invert both halves (R = R_cv.T, t = -R_cv.T @ t_cv), and t_cv
|
|
869
|
+
* is *not* the camera position.
|
|
870
|
+
*
|
|
871
|
+
* Left unset, the pose is the identity and world coordinates come back in the
|
|
872
|
+
* camera frame instead - OpenCV convention, X right, Y down, Z forward.
|
|
873
|
+
*/
|
|
874
|
+
interface CameraExtrinsics {
|
|
875
|
+
rotation?: Quaternion;
|
|
876
|
+
translation?: Vector3d;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* One source's calibration.
|
|
880
|
+
*
|
|
881
|
+
* Exactly one of `intrinsics` and `hfovDegrees` describes the lens. Both is
|
|
882
|
+
* rejected rather than resolved by precedence - two descriptions of one lens
|
|
883
|
+
* that disagree have no right answer - and neither is rejected too, since
|
|
884
|
+
* defaulting a focal length would be inventing a lens.
|
|
885
|
+
*
|
|
886
|
+
* `hfovDegrees` is the shorthand for an operator who knows their lens's field
|
|
887
|
+
* of view but not its calibration matrix. It assumes square pixels and a
|
|
888
|
+
* centred principal point, so it approximates a real calibration rather than
|
|
889
|
+
* replacing one - but it describes the actual lens rather than the worker's
|
|
890
|
+
* assumed fallback. It composes with distortion and extrinsics exactly as
|
|
891
|
+
* intrinsics do.
|
|
892
|
+
*/
|
|
893
|
+
interface Camera {
|
|
894
|
+
intrinsics?: CameraIntrinsics;
|
|
895
|
+
hfovDegrees?: number;
|
|
896
|
+
distortion?: CameraDistortion;
|
|
897
|
+
extrinsics?: CameraExtrinsics;
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Throw if the calibration cannot describe a real camera.
|
|
901
|
+
*
|
|
902
|
+
* Checked locally so a bad one fails before an upload starts rather than as a
|
|
903
|
+
* 400 partway through it. The rules are the worker's, not stricter ones.
|
|
904
|
+
*/
|
|
905
|
+
declare function validateCamera(camera: Camera): void;
|
|
906
|
+
|
|
753
907
|
declare enum PredictionVersion {
|
|
754
908
|
V1 = 1,
|
|
755
909
|
V2 = 2
|
|
@@ -831,6 +985,23 @@ interface BaseComponent {
|
|
|
831
985
|
type: PopComponentType;
|
|
832
986
|
id?: number;
|
|
833
987
|
forward?: PopForward;
|
|
988
|
+
/**
|
|
989
|
+
* Enrich this component's point based predictions with world coordinates,
|
|
990
|
+
* back-projected through the Pop's `depthMap`.
|
|
991
|
+
*
|
|
992
|
+
* Declared here because the instance declares it on one shared component
|
|
993
|
+
* type, but only a component that runs its own inference can honour it -
|
|
994
|
+
* inference and tracking - since that is what gives it an id for the worker
|
|
995
|
+
* to select on. Asking for it on a forward, contour finder or component
|
|
996
|
+
* finder is rejected when the Pop is compiled. A contour finder's points do
|
|
997
|
+
* get enriched, but they belong to the object that fed it, so the request
|
|
998
|
+
* goes on the inference component upstream.
|
|
999
|
+
*
|
|
1000
|
+
* Enrichment needs a *metric* depth ability. A `relative` map is accepted
|
|
1001
|
+
* and silently produces no world coordinates: its shift is unknown, so a
|
|
1002
|
+
* cloud recovered from it would be distorted rather than merely unscaled.
|
|
1003
|
+
*/
|
|
1004
|
+
toWorld?: boolean;
|
|
834
1005
|
}
|
|
835
1006
|
interface ForwardComponent extends BaseComponent {
|
|
836
1007
|
}
|
|
@@ -913,10 +1084,62 @@ interface ComponentFinderComponent extends BaseComponent {
|
|
|
913
1084
|
componentClassLabel?: string;
|
|
914
1085
|
}
|
|
915
1086
|
type PopComponent = ForwardComponent | InferenceComponent | TrackingComponent | ContourFinderComponent | ComponentFinderComponent;
|
|
1087
|
+
/**
|
|
1088
|
+
* The depth ability whose frame level map feeds world coordinates.
|
|
1089
|
+
*
|
|
1090
|
+
* `ability` names it by alias and `abilityUuid` by uuid; give exactly one. A
|
|
1091
|
+
* Pop has one depth map because the worker back-projects every prediction
|
|
1092
|
+
* through it, so a second depth source would have nowhere to go. Naming one
|
|
1093
|
+
* makes the converter build the depth branch itself and keep it out of the
|
|
1094
|
+
* response - the caller asked for coordinates, not for a megabyte of base64
|
|
1095
|
+
* depth per frame.
|
|
1096
|
+
*
|
|
1097
|
+
* `toWorld` back-projects the map itself, so the response carries a point cloud
|
|
1098
|
+
* of the whole scene rather than one per segmented object. It is also what
|
|
1099
|
+
* reveals the map: without it the injected branch stays out of the response
|
|
1100
|
+
* entirely. Read the result with cloudOfDepth().
|
|
1101
|
+
*
|
|
1102
|
+
* Use a *metric* depth ability. A `relative` one is accepted and yields no
|
|
1103
|
+
* world coordinates at all.
|
|
1104
|
+
*/
|
|
1105
|
+
interface PopDepthMap {
|
|
1106
|
+
ability?: string;
|
|
1107
|
+
abilityUuid?: string;
|
|
1108
|
+
toWorld?: boolean;
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Source level parameters a Pop applies to every source it processes, each
|
|
1112
|
+
* overridable per source.
|
|
1113
|
+
*
|
|
1114
|
+
* Merged per field against whatever a source supplies, so a source giving its
|
|
1115
|
+
* own roi but no camera keeps its roi and takes the default camera. Because the
|
|
1116
|
+
* camera merges as one field, a source declaring its own lens replaces a
|
|
1117
|
+
* defaulted one outright rather than mixing the two.
|
|
1118
|
+
*/
|
|
1119
|
+
interface SourceDefaults {
|
|
1120
|
+
camera?: Camera;
|
|
1121
|
+
roi?: Area;
|
|
1122
|
+
fps?: string;
|
|
1123
|
+
motionDetect?: boolean;
|
|
1124
|
+
motionSensitivity?: number;
|
|
1125
|
+
motionThreshold?: number;
|
|
1126
|
+
motionGap?: number;
|
|
1127
|
+
motionGridX?: number;
|
|
1128
|
+
motionGridY?: number;
|
|
1129
|
+
}
|
|
916
1130
|
interface Pop {
|
|
917
1131
|
components: PopComponent[];
|
|
918
1132
|
postTransform?: string;
|
|
1133
|
+
defaults?: SourceDefaults;
|
|
1134
|
+
depthMap?: PopDepthMap;
|
|
919
1135
|
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Throw if a Pop cannot mean what it says.
|
|
1138
|
+
*
|
|
1139
|
+
* Only the parts a caller can get wrong locally: the worker rejects both of
|
|
1140
|
+
* these too, but as a 400 once the Pop is already in flight.
|
|
1141
|
+
*/
|
|
1142
|
+
declare function validatePop(pop: Pop): void;
|
|
920
1143
|
interface MotionDetectConfig {
|
|
921
1144
|
motionDetect: boolean;
|
|
922
1145
|
motionSensitivity?: number;
|
|
@@ -936,6 +1159,16 @@ interface ProcessParams {
|
|
|
936
1159
|
motionDetect?: MotionDetectConfig | undefined;
|
|
937
1160
|
roi?: Area | undefined;
|
|
938
1161
|
fps?: string | undefined;
|
|
1162
|
+
/**
|
|
1163
|
+
* This source's camera calibration, overriding the Pop's `defaults.camera`.
|
|
1164
|
+
*
|
|
1165
|
+
* Without one the worker assumes a 60 degree horizontal field of view,
|
|
1166
|
+
* which is a development scaffold: for canonical metric depth the guess
|
|
1167
|
+
* cancels out of X and Y and survives only in Z, so lateral measurements
|
|
1168
|
+
* stay exact while every distance along the optical axis is wrong by
|
|
1169
|
+
* however wrong the guess was.
|
|
1170
|
+
*/
|
|
1171
|
+
camera?: Camera | undefined;
|
|
939
1172
|
}
|
|
940
1173
|
interface ProcessRequest extends ProcessParams {
|
|
941
1174
|
source: Source;
|
|
@@ -1189,6 +1422,16 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
|
1189
1422
|
*/
|
|
1190
1423
|
process({ source, componentParams, motionDetect, roi }: ProcessRequest): Promise<ResultStream>;
|
|
1191
1424
|
private processV1;
|
|
1425
|
+
/**
|
|
1426
|
+
* Reject a source's calibration before any work is started for it.
|
|
1427
|
+
*
|
|
1428
|
+
* Called by every entry point that takes ProcessParams rather than at the
|
|
1429
|
+
* one boundary they share, because they have none: the group methods build
|
|
1430
|
+
* their jobs directly instead of going through processV2. It runs before
|
|
1431
|
+
* the concurrency limit is acquired, so a request that can never be sent
|
|
1432
|
+
* does not hold a slot.
|
|
1433
|
+
*/
|
|
1434
|
+
private validateProcessParams;
|
|
1192
1435
|
private processV2;
|
|
1193
1436
|
uploadGroup(paths: string[], params?: ProcessParams): Promise<ResultStream>;
|
|
1194
1437
|
uploadStreamGroup(streams: Array<ReadableStream<Uint8Array> | Blob | BufferSource>, mimeTypes?: string[], params?: ProcessParams): Promise<ResultStream>;
|
|
@@ -1251,12 +1494,21 @@ declare class EvaluateDatasetJob {
|
|
|
1251
1494
|
cancel(): void;
|
|
1252
1495
|
}
|
|
1253
1496
|
|
|
1497
|
+
declare class EyePopDataWebSocketError extends Error {
|
|
1498
|
+
readonly code = "DATA_WEBSOCKET_CONNECTION_FAILED";
|
|
1499
|
+
readonly endpoint: string;
|
|
1500
|
+
readonly sourceError: unknown;
|
|
1501
|
+
constructor(url: string, event: unknown);
|
|
1502
|
+
}
|
|
1254
1503
|
declare class DataEndpoint extends Endpoint<DataEndpoint> {
|
|
1255
1504
|
private datasetApiUrl;
|
|
1256
1505
|
private vlmApiUrl;
|
|
1257
1506
|
private _accountId;
|
|
1258
1507
|
private _ws;
|
|
1259
1508
|
private _ws_current_reconnect_delay;
|
|
1509
|
+
private _ws_reconnect_timeout;
|
|
1510
|
+
private _ws_reconnect_enabled;
|
|
1511
|
+
private _ws_connecting;
|
|
1260
1512
|
private _account_event_handlers;
|
|
1261
1513
|
private _dataset_uuid_to_event_handlers;
|
|
1262
1514
|
constructor(options: DataOptions);
|
|
@@ -1264,6 +1516,9 @@ declare class DataEndpoint extends Endpoint<DataEndpoint> {
|
|
|
1264
1516
|
disconnect(wait?: boolean): Promise<void>;
|
|
1265
1517
|
protected reconnect(): Promise<DataEndpoint>;
|
|
1266
1518
|
private reconnect_ws;
|
|
1519
|
+
private open_ws;
|
|
1520
|
+
private close_ws;
|
|
1521
|
+
private schedule_ws_reconnect;
|
|
1267
1522
|
private options;
|
|
1268
1523
|
private request;
|
|
1269
1524
|
listDatasets(include_stats?: boolean, modifiable_version_only?: boolean): Promise<Dataset[]>;
|
|
@@ -1373,6 +1628,123 @@ declare class DepthMap {
|
|
|
1373
1628
|
*/
|
|
1374
1629
|
declare function decodeDepthMap(depth: Depth): DepthMap;
|
|
1375
1630
|
|
|
1631
|
+
/**
|
|
1632
|
+
* Decoding and sampling of point clouds.
|
|
1633
|
+
*
|
|
1634
|
+
* When a pipeline is asked for world coordinates, an object carrying a
|
|
1635
|
+
* segmentation mask also carries `mask.world`: three little-endian float32
|
|
1636
|
+
* values per mask pixel, row-major, exactly width*height triples. The point for
|
|
1637
|
+
* bitmap pixel (i, j) sits at triple index j * width + i, so the cloud indexes
|
|
1638
|
+
* exactly like the bitmap with no separate lookup.
|
|
1639
|
+
*
|
|
1640
|
+
* A Pop asking for `depthMap.toWorld` also gets `depth.world`, the same
|
|
1641
|
+
* encoding on the depth map's own grid: one point per map pixel rather than per
|
|
1642
|
+
* mask pixel, covering the whole scene.
|
|
1643
|
+
*
|
|
1644
|
+
* Points the worker could not place are NaN - sky pixels, samples outside the
|
|
1645
|
+
* depth map, and pixels the mask does not cover. NaN is the omission sentinel
|
|
1646
|
+
* here, which is why this does not share decodeDepthMap()'s validation: that
|
|
1647
|
+
* one rejects a payload of the wrong length, but nothing here may reject a NaN.
|
|
1648
|
+
*/
|
|
1649
|
+
|
|
1650
|
+
/** Where a cloud's grid sits in the source frame, so at() can be reached from source pixels. */
|
|
1651
|
+
interface CloudBox {
|
|
1652
|
+
x: number;
|
|
1653
|
+
y: number;
|
|
1654
|
+
width: number;
|
|
1655
|
+
height: number;
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* A decoded point cloud, per object or per scene.
|
|
1659
|
+
*
|
|
1660
|
+
* Create with decodePointCloud(), cloudOfObject(), cloudOfDepth() or
|
|
1661
|
+
* cloudsOfPrediction(). Coordinates are metres, in the frame the source's
|
|
1662
|
+
* camera extrinsics define (Z up, ground at Z = 0) or the OpenCV camera frame
|
|
1663
|
+
* when it supplied none.
|
|
1664
|
+
*
|
|
1665
|
+
* The grid is whatever the cloud was made from: an object's mask, which spans
|
|
1666
|
+
* its bounding box rather than the frame, or the depth map itself, which spans
|
|
1667
|
+
* the whole frame. Either way (i, j) is a source coordinate only via that box,
|
|
1668
|
+
* which cloudOfObject() and cloudOfDepth() record - so atSource() needs one of
|
|
1669
|
+
* those two.
|
|
1670
|
+
*/
|
|
1671
|
+
declare class PointCloud {
|
|
1672
|
+
readonly width: number;
|
|
1673
|
+
readonly height: number;
|
|
1674
|
+
/** xyz per pixel, row-major; an omitted point is NaN in all three. */
|
|
1675
|
+
readonly points: Float32Array;
|
|
1676
|
+
private readonly box;
|
|
1677
|
+
constructor(width: number, height: number, points: Float32Array, box?: CloudBox);
|
|
1678
|
+
/**
|
|
1679
|
+
* The world point for pixel (i, j), or undefined where the worker placed none.
|
|
1680
|
+
*
|
|
1681
|
+
* (i, j) indexes the cloud's own grid - the mask bitmap, or the depth map
|
|
1682
|
+
* for a scene cloud: i is the column, j is the row.
|
|
1683
|
+
*/
|
|
1684
|
+
at(i: number, j: number): Vector3 | undefined;
|
|
1685
|
+
/**
|
|
1686
|
+
* The world point for a source frame coordinate inside the cloud's box.
|
|
1687
|
+
*
|
|
1688
|
+
* Needs a cloud built with cloudOfObject(), or with cloudOfDepth() and the
|
|
1689
|
+
* frame size: the grid covers a box, and nothing else knows where it sits.
|
|
1690
|
+
*/
|
|
1691
|
+
atSource(x: number, y: number): Vector3 | undefined;
|
|
1692
|
+
isPlaced(i: number, j: number): boolean;
|
|
1693
|
+
/**
|
|
1694
|
+
* Just the points the worker placed.
|
|
1695
|
+
*
|
|
1696
|
+
* The shape a scatter plot or an export wants: the grid with its NaN holes
|
|
1697
|
+
* dropped, and no mask to apply first.
|
|
1698
|
+
*/
|
|
1699
|
+
get placedPoints(): Vector3[];
|
|
1700
|
+
/**
|
|
1701
|
+
* Per axis (min, max) in metres over the placed points, or undefined if none were.
|
|
1702
|
+
*
|
|
1703
|
+
* The counterpart to DepthMap's finiteMin/finiteMax, which are one axis
|
|
1704
|
+
* because a depth map has one value per pixel.
|
|
1705
|
+
*/
|
|
1706
|
+
get bounds(): CloudBounds | undefined;
|
|
1707
|
+
}
|
|
1708
|
+
interface Vector3 {
|
|
1709
|
+
x: number;
|
|
1710
|
+
y: number;
|
|
1711
|
+
z: number;
|
|
1712
|
+
}
|
|
1713
|
+
interface CloudBounds {
|
|
1714
|
+
min: Vector3;
|
|
1715
|
+
max: Vector3;
|
|
1716
|
+
}
|
|
1717
|
+
/** A mask's point cloud, or undefined if it carries none. */
|
|
1718
|
+
declare function decodePointCloud(mask: Mask | undefined, box?: CloudBox): PointCloud | undefined;
|
|
1719
|
+
/**
|
|
1720
|
+
* The point cloud of a predicted object's mask, or undefined if it has none.
|
|
1721
|
+
*
|
|
1722
|
+
* Records the object's bounding box, so atSource() works.
|
|
1723
|
+
*/
|
|
1724
|
+
declare function cloudOfObject(obj: PredictedObject | undefined): PointCloud | undefined;
|
|
1725
|
+
/**
|
|
1726
|
+
* The scene point cloud of a frame level depth map, or undefined if it has none.
|
|
1727
|
+
*
|
|
1728
|
+
* Present when the Pop asked for `depthMap.toWorld`. Unlike a mask cloud this
|
|
1729
|
+
* one spans the whole frame, so its grid is the depth map's rather than an
|
|
1730
|
+
* object's bounding box - and at(i, j) indexes map pixels, the same index that
|
|
1731
|
+
* pixel's value sits at in `depth.values`.
|
|
1732
|
+
*
|
|
1733
|
+
* Pass the prediction's source_width/source_height to enable atSource(); the
|
|
1734
|
+
* frame is the box in this case.
|
|
1735
|
+
*/
|
|
1736
|
+
declare function cloudOfDepth(depth: Depth | undefined, sourceWidth?: number, sourceHeight?: number): PointCloud | undefined;
|
|
1737
|
+
/**
|
|
1738
|
+
* Every point cloud in a prediction, outermost object first.
|
|
1739
|
+
*
|
|
1740
|
+
* An array rather than a single value like decodeDepthMap(), because a cloud
|
|
1741
|
+
* belongs to one object's mask and a prediction carries as many as it has
|
|
1742
|
+
* masked objects. Nested objects are included. A scene cloud, if the Pop asked
|
|
1743
|
+
* for one, comes last - appended rather than inserted so an existing index into
|
|
1744
|
+
* the object clouds keeps meaning what it did.
|
|
1745
|
+
*/
|
|
1746
|
+
declare function cloudsOfPrediction(prediction: Prediction | undefined): PointCloud[];
|
|
1747
|
+
|
|
1376
1748
|
type Bytes = string | ArrayBuffer | Uint8Array | Buffer | null | undefined;
|
|
1377
1749
|
interface StreamEvent {
|
|
1378
1750
|
type: string;
|
|
@@ -1551,4 +1923,4 @@ declare namespace EyePop {
|
|
|
1551
1923
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
1552
1924
|
}
|
|
1553
1925
|
|
|
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 };
|
|
1926
|
+
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 Camera, type CameraDistortion, type CameraExtrinsics, type CameraIntrinsics, type ChangeEvent, ChangeType, type ClassificationTask, type CloudBounds, type CloudBox, 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 DepthSemantic, type DownloadResponse, Endpoint, EndpointState, type EvaluateConfig, type EvaluateFilter, type EvaluateRequest, type EvaluateResponse, type EvaluateRunInfo, EvaluationStatus, ExportedBy, EyePop, EyePopDataWebSocketError, 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, PointCloud, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopDepthMap, 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, QUATERNION_TOLERANCE, type QcAiHubExportParams, type Quaternion, type RectangleArea, type ResultStream, type Roi, Semaphore, type Session, type SessionAuth, type Source, type SourceDefaults, Stream, type StreamEvent, type StreamSource, type StreamTime, TaskMode, TaskType, type TimeSpan, type TrackingComponent, TranscodeMode, type TransformInto, TransientPopId, UploadGroupJob, UploadJob, type UploadSource, type UrlSource, UserReview, type Vector3, type Vector3d, 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, cloudOfDepth, cloudOfObject, cloudsOfPrediction, decodeDepthMap, decodePointCloud, EyePop as default, encodeMultipartFormData, getBaseUrl, randomMultipartBoundary, readableStreamFromString, resolveAuth, validateCamera, validatePop };
|