@eyepop.ai/eyepop 0.22.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,79 +10056,41 @@ 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) {
10074
- const client = this._client;
10075
- const baseUrl = this._baseUrl;
10076
- if (!baseUrl || !client) {
10077
- return Promise.reject("endpoint not connected, use connect() before changePopComp()");
10078
- }
10079
- const body = {
10080
- "pipeline": popComp
10081
- };
10082
- let response = await this.fetchWithRetry(async () => {
10083
- const session = await this.session();
10084
- let headers = {
10085
- "Authorization": `Bearer ${session.accessToken}`,
10086
- "Content-Type": "application/json"
10087
- };
10088
- const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/inferencePipeline`;
10089
- return client.fetch(patch_url, {
10090
- method: "PATCH",
10091
- body: JSON.stringify(body),
10092
- headers
10093
- });
10094
- });
10095
- if (response.status != 204) {
10096
- const message = await response.text();
10097
- return Promise.reject(`Unexpected status ${response.status}: ${message}`);
10098
- }
10099
- if (this._pipeline) {
10100
- this._pipeline.inferPipeline = popComp;
10101
- }
10102
- }
10103
- async changePostTransform(postTransform) {
10066
+ async changePop(pop) {
10104
10067
  const client = this._client;
10105
10068
  const baseUrl = this._baseUrl;
10106
10069
  if (!baseUrl || !client) {
10107
10070
  return Promise.reject("endpoint not connected, use connect() before changePopComp()");
10108
10071
  }
10109
- postTransform = postTransform ? postTransform : null;
10110
- const body = {
10111
- "transform": postTransform
10112
- };
10113
10072
  let response = await this.fetchWithRetry(async () => {
10114
10073
  const session = await this.session();
10115
10074
  let headers = {
10116
10075
  "Authorization": `Bearer ${session.accessToken}`,
10117
10076
  "Content-Type": "application/json"
10118
10077
  };
10119
- const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/postTransform`;
10078
+ const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/pop`;
10079
+ this._requestLogger.debug("before PATCH %s - %s", patch_url, JSON.stringify(pop));
10120
10080
  return client.fetch(patch_url, {
10121
10081
  method: "PATCH",
10122
- body: JSON.stringify(body),
10082
+ body: JSON.stringify(pop),
10123
10083
  headers
10124
10084
  });
10125
10085
  });
10126
10086
  if (response.status != 204) {
10127
10087
  const message = await response.text();
10088
+ console.error(message);
10128
10089
  return Promise.reject(`Unexpected status ${response.status}: ${message}`);
10129
10090
  }
10091
+ this._requestLogger.debug("after PATCH pop");
10130
10092
  if (this._pipeline) {
10131
- this._pipeline.postTransform = postTransform;
10093
+ this._pipeline.pop = pop;
10132
10094
  }
10133
10095
  }
10134
10096
  popId() {
@@ -10393,7 +10355,7 @@ var WorkerEndpoint = class extends Endpoint {
10393
10355
  }
10394
10356
  }
10395
10357
  if (this.options().popId == "transient" /* Transient */) {
10396
- this._pipelineId = await this.startPopLessPipeline();
10358
+ this._pipelineId = await this.startTransientPipeline();
10397
10359
  this._popName = this.options().popId || null;
10398
10360
  } else {
10399
10361
  this._pipelineId = config.pipeline_id;
@@ -10441,32 +10403,23 @@ var WorkerEndpoint = class extends Endpoint {
10441
10403
  this.updateState();
10442
10404
  return Promise.resolve(this);
10443
10405
  }
10444
- async startPopLessPipeline() {
10406
+ async startTransientPipeline() {
10445
10407
  const client = this._client;
10446
10408
  const baseUrl = this._baseUrl;
10447
10409
  const sandboxId = this._sandboxId;
10448
10410
  if (client == null || baseUrl == null) {
10449
10411
  return Promise.reject("endpoint not initialized");
10450
10412
  }
10451
- let pipeline;
10452
- if (this._pipeline) {
10453
- pipeline = this._pipeline.inferPipeline;
10454
- } else {
10455
- pipeline = "identity";
10456
- }
10457
- let postTransform;
10458
- if (this._pipeline && this._pipeline.postTransform) {
10459
- postTransform = this._pipeline.postTransform;
10413
+ let pop;
10414
+ if (this._pipeline && this._pipeline.pop) {
10415
+ pop = this._pipeline.pop;
10460
10416
  } else {
10461
- postTransform = null;
10417
+ pop = {
10418
+ components: []
10419
+ };
10462
10420
  }
10463
10421
  const body = {
10464
- "inferPipelineDef": {
10465
- "pipeline": pipeline
10466
- },
10467
- "postTransformDef": {
10468
- "transform": postTransform
10469
- },
10422
+ "pop": pop,
10470
10423
  "source": {
10471
10424
  "sourceType": "NONE"
10472
10425
  },
@@ -11206,6 +11159,41 @@ var ModelPrecisionType = /* @__PURE__ */ ((ModelPrecisionType2) => {
11206
11159
  ModelPrecisionType2["uint8"] = "uint8";
11207
11160
  return ModelPrecisionType2;
11208
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 || {});
11209
11197
 
11210
11198
  // index.ts
11211
11199
  var readEnv = (env) => {
@@ -11302,19 +11290,33 @@ var EyePop;
11302
11290
  })(EyePop || (EyePop = {}));
11303
11291
  var eyepop_default = EyePop;
11304
11292
  export {
11293
+ AbstractJob,
11305
11294
  AnnotationType,
11306
11295
  AssetStatus,
11307
11296
  ChangeType,
11297
+ ContourType,
11308
11298
  DataEndpoint,
11299
+ Endpoint,
11309
11300
  EndpointState,
11310
11301
  EyePop,
11302
+ ForwardOperatorType,
11303
+ InferenceType,
11304
+ LoadFromJob,
11305
+ LoadLiveIngressJob,
11311
11306
  ModelFormat,
11312
11307
  ModelPrecisionType,
11313
11308
  ModelStatus,
11314
11309
  ModelType,
11310
+ PopComponentType,
11311
+ Semaphore,
11312
+ Stream,
11315
11313
  TranscodeMode,
11316
11314
  TransientPopId,
11315
+ UploadJob,
11317
11316
  UserReview,
11317
+ WebrtcBase,
11318
+ WebrtcWhep,
11319
+ WebrtcWhip,
11318
11320
  WorkerEndpoint,
11319
11321
  eyepop_default as default
11320
11322
  };