@eyepop.ai/eyepop 0.23.0 → 1.0.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.
@@ -10056,40 +10056,30 @@ var WorkerEndpoint = class extends Endpoint {
10056
10056
  popName() {
10057
10057
  return this._popName;
10058
10058
  }
10059
- popComp() {
10059
+ pop() {
10060
10060
  if (this._pipeline) {
10061
- return this._pipeline.inferPipeline;
10061
+ return this._pipeline.pop || null;
10062
10062
  } else {
10063
10063
  return null;
10064
10064
  }
10065
10065
  }
10066
- postTransform() {
10067
- if (this._pipeline) {
10068
- return this._pipeline.postTransform;
10069
- } else {
10070
- return null;
10071
- }
10072
- }
10073
- async changePopComp(popComp, modelRefs = []) {
10066
+ async changePop(pop) {
10074
10067
  const client = this._client;
10075
10068
  const baseUrl = this._baseUrl;
10076
10069
  if (!baseUrl || !client) {
10077
10070
  return Promise.reject("endpoint not connected, use connect() before changePopComp()");
10078
10071
  }
10079
- const body = {
10080
- "pipeline": popComp,
10081
- "modelRefs": modelRefs
10082
- };
10083
10072
  let response = await this.fetchWithRetry(async () => {
10084
10073
  const session = await this.session();
10085
10074
  let headers = {
10086
10075
  "Authorization": `Bearer ${session.accessToken}`,
10087
10076
  "Content-Type": "application/json"
10088
10077
  };
10089
- const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/inferencePipeline`;
10078
+ const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/pop`;
10079
+ this._requestLogger.debug("before PATCH %s - %s", patch_url, JSON.stringify(pop));
10090
10080
  return client.fetch(patch_url, {
10091
10081
  method: "PATCH",
10092
- body: JSON.stringify(body),
10082
+ body: JSON.stringify(pop),
10093
10083
  headers
10094
10084
  });
10095
10085
  });
@@ -10098,40 +10088,9 @@ var WorkerEndpoint = class extends Endpoint {
10098
10088
  console.error(message);
10099
10089
  return Promise.reject(`Unexpected status ${response.status}: ${message}`);
10100
10090
  }
10091
+ this._requestLogger.debug("after PATCH pop");
10101
10092
  if (this._pipeline) {
10102
- this._pipeline.inferPipeline = popComp;
10103
- this._pipeline.modelRefs = modelRefs;
10104
- }
10105
- }
10106
- async changePostTransform(postTransform) {
10107
- const client = this._client;
10108
- const baseUrl = this._baseUrl;
10109
- if (!baseUrl || !client) {
10110
- return Promise.reject("endpoint not connected, use connect() before changePopComp()");
10111
- }
10112
- postTransform = postTransform ? postTransform : null;
10113
- const body = {
10114
- "transform": postTransform
10115
- };
10116
- let response = await this.fetchWithRetry(async () => {
10117
- const session = await this.session();
10118
- let headers = {
10119
- "Authorization": `Bearer ${session.accessToken}`,
10120
- "Content-Type": "application/json"
10121
- };
10122
- const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/postTransform`;
10123
- return client.fetch(patch_url, {
10124
- method: "PATCH",
10125
- body: JSON.stringify(body),
10126
- headers
10127
- });
10128
- });
10129
- if (response.status != 204) {
10130
- const message = await response.text();
10131
- return Promise.reject(`Unexpected status ${response.status}: ${message}`);
10132
- }
10133
- if (this._pipeline) {
10134
- this._pipeline.postTransform = postTransform;
10093
+ this._pipeline.pop = pop;
10135
10094
  }
10136
10095
  }
10137
10096
  popId() {
@@ -10396,7 +10355,7 @@ var WorkerEndpoint = class extends Endpoint {
10396
10355
  }
10397
10356
  }
10398
10357
  if (this.options().popId == "transient" /* Transient */) {
10399
- this._pipelineId = await this.startPopLessPipeline();
10358
+ this._pipelineId = await this.startTransientPipeline();
10400
10359
  this._popName = this.options().popId || null;
10401
10360
  } else {
10402
10361
  this._pipelineId = config.pipeline_id;
@@ -10444,39 +10403,23 @@ var WorkerEndpoint = class extends Endpoint {
10444
10403
  this.updateState();
10445
10404
  return Promise.resolve(this);
10446
10405
  }
10447
- async startPopLessPipeline() {
10406
+ async startTransientPipeline() {
10448
10407
  const client = this._client;
10449
10408
  const baseUrl = this._baseUrl;
10450
10409
  const sandboxId = this._sandboxId;
10451
10410
  if (client == null || baseUrl == null) {
10452
10411
  return Promise.reject("endpoint not initialized");
10453
10412
  }
10454
- let pipeline;
10455
- if (this._pipeline) {
10456
- pipeline = this._pipeline.inferPipeline;
10457
- } else {
10458
- pipeline = "identity";
10459
- }
10460
- let postTransform;
10461
- if (this._pipeline && this._pipeline.postTransform) {
10462
- postTransform = this._pipeline.postTransform;
10413
+ let pop;
10414
+ if (this._pipeline && this._pipeline.pop) {
10415
+ pop = this._pipeline.pop;
10463
10416
  } else {
10464
- postTransform = null;
10465
- }
10466
- let modelRefs;
10467
- if (this._pipeline && this._pipeline.modelRefs) {
10468
- modelRefs = this._pipeline.modelRefs;
10469
- } else {
10470
- modelRefs = [];
10417
+ pop = {
10418
+ components: []
10419
+ };
10471
10420
  }
10472
10421
  const body = {
10473
- "inferPipelineDef": {
10474
- "pipeline": pipeline,
10475
- "modelRefs": modelRefs
10476
- },
10477
- "postTransformDef": {
10478
- "transform": postTransform
10479
- },
10422
+ "pop": pop,
10480
10423
  "source": {
10481
10424
  "sourceType": "NONE"
10482
10425
  },
@@ -11216,6 +11159,41 @@ var ModelPrecisionType = /* @__PURE__ */ ((ModelPrecisionType2) => {
11216
11159
  ModelPrecisionType2["uint8"] = "uint8";
11217
11160
  return ModelPrecisionType2;
11218
11161
  })(ModelPrecisionType || {});
11162
+ var PopComponentType = /* @__PURE__ */ ((PopComponentType2) => {
11163
+ PopComponentType2["FORWARD"] = "forward";
11164
+ PopComponentType2["INFERENCE"] = "inference";
11165
+ PopComponentType2["TRACING"] = "tracing";
11166
+ PopComponentType2["CONTOUR_FINDER"] = "contour_finder";
11167
+ PopComponentType2["COMPONENT_FINDER"] = "component_finder";
11168
+ return PopComponentType2;
11169
+ })(PopComponentType || {});
11170
+ var ForwardOperatorType = /* @__PURE__ */ ((ForwardOperatorType2) => {
11171
+ ForwardOperatorType2["FULL"] = "full";
11172
+ ForwardOperatorType2["CROP"] = "crop";
11173
+ ForwardOperatorType2["CROP_WITH_FULL_FALLBACK"] = "crop_with_full_fallback";
11174
+ return ForwardOperatorType2;
11175
+ })(ForwardOperatorType || {});
11176
+ var InferenceType = /* @__PURE__ */ ((InferenceType2) => {
11177
+ InferenceType2["IMAGE_CLASSIFICATION"] = "image_classification";
11178
+ InferenceType2["OBJECT_DETECTION"] = "object_detection";
11179
+ InferenceType2["KEY_POINTS"] = "key_points";
11180
+ InferenceType2["OCR"] = "ocr";
11181
+ InferenceType2["MESH"] = "mesh";
11182
+ InferenceType2["FEATURE_VECTOR"] = "feature_vector";
11183
+ InferenceType2["SEMANTIC_SEGMENTATION"] = "semantic_segmentation";
11184
+ InferenceType2["SEGMENTATION"] = "segmentation";
11185
+ return InferenceType2;
11186
+ })(InferenceType || {});
11187
+ var ContourType = /* @__PURE__ */ ((ContourType2) => {
11188
+ ContourType2["ALL_PIXELS"] = "all_pixels";
11189
+ ContourType2["POLYGON"] = "polygon";
11190
+ ContourType2["CONVEX_HULL"] = "convex_hull";
11191
+ ContourType2["HOUGH_CIRCLES"] = "hough_circles";
11192
+ ContourType2["CIRCLE"] = "circle";
11193
+ ContourType2["TRIANGLE"] = "triangle";
11194
+ ContourType2["RECTANGLE"] = "rectangle";
11195
+ return ContourType2;
11196
+ })(ContourType || {});
11219
11197
 
11220
11198
  // index.ts
11221
11199
  var readEnv = (env) => {
@@ -11316,16 +11294,20 @@ export {
11316
11294
  AnnotationType,
11317
11295
  AssetStatus,
11318
11296
  ChangeType,
11297
+ ContourType,
11319
11298
  DataEndpoint,
11320
11299
  Endpoint,
11321
11300
  EndpointState,
11322
11301
  EyePop,
11302
+ ForwardOperatorType,
11303
+ InferenceType,
11323
11304
  LoadFromJob,
11324
11305
  LoadLiveIngressJob,
11325
11306
  ModelFormat,
11326
11307
  ModelPrecisionType,
11327
11308
  ModelStatus,
11328
11309
  ModelType,
11310
+ PopComponentType,
11329
11311
  Semaphore,
11330
11312
  Stream,
11331
11313
  TranscodeMode,