@eyepop.ai/eyepop 1.6.0 → 1.6.2

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.
@@ -369,13 +369,15 @@ declare enum InferenceType {
369
369
  interface InferenceComponent extends BaseComponent {
370
370
  inferenceTypes: InferenceType[];
371
371
  hidden?: boolean;
372
- modelUuid: string;
372
+ modelUuid?: string;
373
+ model?: string;
373
374
  categoryName?: string;
374
375
  confidenceThreshold?: number;
375
376
  targetFps?: string;
376
377
  }
377
378
  interface TracingComponent extends BaseComponent {
378
379
  reidModelUuid?: string;
380
+ reidModel?: string;
379
381
  maxAgeSeconds?: number;
380
382
  iouThreshold?: number;
381
383
  simThreshold?: number;
@@ -404,6 +406,10 @@ interface Pop {
404
406
  postTransform?: string;
405
407
  }
406
408
 
409
+ interface ModelRef {
410
+ id: string;
411
+ folderUrl: string;
412
+ }
407
413
  declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
408
414
  private _baseUrl;
409
415
  private _pipelineId;
@@ -420,6 +426,22 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
420
426
  popName(): string | null;
421
427
  pop(): Pop | null;
422
428
  changePop(pop: Pop): Promise<void>;
429
+ /**
430
+ * @deprecated use pop() instead
431
+ */
432
+ popComp(): string | null;
433
+ /**
434
+ * @deprecated use changePop() instead
435
+ */
436
+ changePopComp(popComp: string, modelRefs?: ModelRef[]): Promise<void>;
437
+ /**
438
+ * @deprecated use pop() instead
439
+ */
440
+ postTransform(): string | null;
441
+ /**
442
+ * @deprecated use changePop() instead
443
+ */
444
+ changePostTransform(postTransform: string | null): Promise<void>;
423
445
  popId(): string | null;
424
446
  onIngressEvent(handler: (event: IngressEvent) => void): WorkerEndpoint;
425
447
  liveIngress(stream: MediaStream): Promise<LiveMedia>;
@@ -369,13 +369,15 @@ declare enum InferenceType {
369
369
  interface InferenceComponent extends BaseComponent {
370
370
  inferenceTypes: InferenceType[];
371
371
  hidden?: boolean;
372
- modelUuid: string;
372
+ modelUuid?: string;
373
+ model?: string;
373
374
  categoryName?: string;
374
375
  confidenceThreshold?: number;
375
376
  targetFps?: string;
376
377
  }
377
378
  interface TracingComponent extends BaseComponent {
378
379
  reidModelUuid?: string;
380
+ reidModel?: string;
379
381
  maxAgeSeconds?: number;
380
382
  iouThreshold?: number;
381
383
  simThreshold?: number;
@@ -404,6 +406,10 @@ interface Pop {
404
406
  postTransform?: string;
405
407
  }
406
408
 
409
+ interface ModelRef {
410
+ id: string;
411
+ folderUrl: string;
412
+ }
407
413
  declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
408
414
  private _baseUrl;
409
415
  private _pipelineId;
@@ -420,6 +426,22 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
420
426
  popName(): string | null;
421
427
  pop(): Pop | null;
422
428
  changePop(pop: Pop): Promise<void>;
429
+ /**
430
+ * @deprecated use pop() instead
431
+ */
432
+ popComp(): string | null;
433
+ /**
434
+ * @deprecated use changePop() instead
435
+ */
436
+ changePopComp(popComp: string, modelRefs?: ModelRef[]): Promise<void>;
437
+ /**
438
+ * @deprecated use pop() instead
439
+ */
440
+ postTransform(): string | null;
441
+ /**
442
+ * @deprecated use changePop() instead
443
+ */
444
+ changePostTransform(postTransform: string | null): Promise<void>;
423
445
  popId(): string | null;
424
446
  onIngressEvent(handler: (event: IngressEvent) => void): WorkerEndpoint;
425
447
  liveIngress(stream: MediaStream): Promise<LiveMedia>;
@@ -10269,6 +10269,95 @@ var WorkerEndpoint = class extends Endpoint {
10269
10269
  this._pipeline.pop = pop;
10270
10270
  }
10271
10271
  }
10272
+ /**
10273
+ * @deprecated use pop() instead
10274
+ */
10275
+ popComp() {
10276
+ if (this._pipeline) {
10277
+ return this._pipeline.inferPipeline ?? null;
10278
+ } else {
10279
+ return null;
10280
+ }
10281
+ }
10282
+ /**
10283
+ * @deprecated use changePop() instead
10284
+ */
10285
+ async changePopComp(popComp, modelRefs = []) {
10286
+ const client = this._client;
10287
+ const baseUrl = this._baseUrl;
10288
+ if (!baseUrl || !client) {
10289
+ return Promise.reject("endpoint not connected, use connect() before changePopComp()");
10290
+ }
10291
+ const body = {
10292
+ "pipeline": popComp,
10293
+ "modelRefs": modelRefs
10294
+ };
10295
+ let response = await this.fetchWithRetry(async () => {
10296
+ const session = await this.session();
10297
+ let headers = {
10298
+ "Authorization": `Bearer ${session.accessToken}`,
10299
+ "Content-Type": "application/json"
10300
+ };
10301
+ const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/inferencePipeline`;
10302
+ return client.fetch(patch_url, {
10303
+ method: "PATCH",
10304
+ body: JSON.stringify(body),
10305
+ headers
10306
+ });
10307
+ });
10308
+ if (response.status != 204) {
10309
+ const message = await response.text();
10310
+ console.error(message);
10311
+ return Promise.reject(`Unexpected status ${response.status}: ${message}`);
10312
+ }
10313
+ if (this._pipeline) {
10314
+ this._pipeline.inferPipeline = popComp;
10315
+ this._pipeline.modelRefs = modelRefs;
10316
+ }
10317
+ }
10318
+ /**
10319
+ * @deprecated use pop() instead
10320
+ */
10321
+ postTransform() {
10322
+ if (this._pipeline) {
10323
+ return this._pipeline.postTransform;
10324
+ } else {
10325
+ return null;
10326
+ }
10327
+ }
10328
+ /**
10329
+ * @deprecated use changePop() instead
10330
+ */
10331
+ async changePostTransform(postTransform) {
10332
+ const client = this._client;
10333
+ const baseUrl = this._baseUrl;
10334
+ if (!baseUrl || !client) {
10335
+ return Promise.reject("endpoint not connected, use connect() before changePopComp()");
10336
+ }
10337
+ const body = {
10338
+ "transform": postTransform
10339
+ };
10340
+ let response = await this.fetchWithRetry(async () => {
10341
+ const session = await this.session();
10342
+ let headers = {
10343
+ "Authorization": `Bearer ${session.accessToken}`,
10344
+ "Content-Type": "application/json"
10345
+ };
10346
+ const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/postTransform`;
10347
+ return client.fetch(patch_url, {
10348
+ method: "PATCH",
10349
+ body: JSON.stringify(body),
10350
+ headers
10351
+ });
10352
+ });
10353
+ if (response.status != 204) {
10354
+ const message = await response.text();
10355
+ return Promise.reject(`Unexpected status ${response.status}: ${message}`);
10356
+ }
10357
+ if (this._pipeline) {
10358
+ this._pipeline.postTransform = postTransform;
10359
+ }
10360
+ }
10272
10361
  popId() {
10273
10362
  return this.options().popId || null;
10274
10363
  }