@eyepop.ai/eyepop 1.9.2 → 1.10.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 +152 -106
- package/dist/eyepop.index.d.mts +13 -3
- package/dist/eyepop.index.d.ts +13 -3
- package/dist/eyepop.index.js +271 -182
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +271 -182
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/package.json +47 -43
package/README.md
CHANGED
|
@@ -1,98 +1,121 @@
|
|
|
1
1
|
# EyePop.ai Node SDK
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
The EyePop.ai Node SDK provides convenient access to the EyePop.ai's inference API from applications written in the
|
|
3
4
|
TypeScript or JavaScript language.
|
|
5
|
+
|
|
4
6
|
## Installation
|
|
7
|
+
|
|
5
8
|
### Node
|
|
9
|
+
|
|
6
10
|
```shell
|
|
7
11
|
npm install --save @eyepop.ai/eyepop
|
|
8
12
|
```
|
|
13
|
+
|
|
9
14
|
### Browser
|
|
15
|
+
|
|
10
16
|
```html
|
|
11
17
|
<script src="https://cdn.jsdelivr.net/npm/@eyepop.ai/eyepop/dist/eyepop.min.js"></script>
|
|
12
18
|
```
|
|
19
|
+
|
|
13
20
|
## Configuration
|
|
14
|
-
|
|
21
|
+
|
|
22
|
+
The EyePop SDK needs to be configured with the **Pop Id** and your **Authentication Credentials**. Credentials can
|
|
15
23
|
be provided as:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
|
|
25
|
+
1. **Api Key**, server side only because this key must be kept secret
|
|
26
|
+
2. **Session generated from Api Key**, server side generated session transported to client over trusted channel
|
|
27
|
+
3. **Current Browser Session**, for developer running client code in the same browser session loghed into their EyePop Dashboard.
|
|
28
|
+
|
|
19
29
|
### Configuration via Environment (Server Side)
|
|
20
|
-
|
|
30
|
+
|
|
31
|
+
While you can provide a secret_key keyword argument, we recommend using dotenv to add EYEPOP_SECRET_KEY="My API Key"
|
|
21
32
|
to your .env file so that your API Key is not stored in source control. By default, the SDK will read the following environment variables:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
|
|
34
|
+
- `EYEPOP_POP_ID`: The Pop Id to use as an endpoint. You can copy and paste this string from your EyePop Dashboard in the Pop -> Settings section.
|
|
35
|
+
- `EYEPOP_SECRET_KEY`: Your Secret Api Key. You can create Api Keys in the profile section of your EyePop dashboard.
|
|
36
|
+
- `EYEPOP_URL`: (Optional) URL of the EyePop API service, if you want to use any other endpoint than production `http://api.eyepop.ai`
|
|
37
|
+
|
|
25
38
|
### Authentication with Api Key
|
|
39
|
+
|
|
26
40
|
Configuration and authorization with explicit defaults:
|
|
41
|
+
|
|
27
42
|
```typescript
|
|
28
43
|
import { EyePop } from '@eyepop.ai/eyepop'
|
|
29
|
-
|
|
44
|
+
;async () => {
|
|
30
45
|
const endpoint = EyePop.workerEndpoint({
|
|
31
46
|
// This is the default and can be omitted
|
|
32
47
|
popId: process.env['EYEPOP_POP_ID'],
|
|
33
48
|
// This is the default and can be omitted
|
|
34
|
-
auth
|
|
49
|
+
auth: { secretKey: process.env['EYEPOP_SECRET_KEY'] },
|
|
35
50
|
})
|
|
36
51
|
await endpoint.connect()
|
|
37
52
|
// do work ....
|
|
38
53
|
await endpoint.disconnect()
|
|
39
|
-
}
|
|
54
|
+
}
|
|
40
55
|
```
|
|
56
|
+
|
|
41
57
|
Equivalent, but shorter:
|
|
58
|
+
|
|
42
59
|
```typescript
|
|
43
60
|
import { EyePop } from '@eyepop.ai/eyepop'
|
|
44
|
-
|
|
61
|
+
;async () => {
|
|
45
62
|
const endpoint = await EyePop.workerEndpoint().connect()
|
|
46
63
|
// do work ....
|
|
47
64
|
await endpoint.disconnect()
|
|
48
|
-
}
|
|
65
|
+
}
|
|
49
66
|
```
|
|
67
|
+
|
|
50
68
|
### Authentication with session generated from Api Key
|
|
69
|
+
|
|
51
70
|
#### Server Side
|
|
52
71
|
|
|
53
72
|
```javascript
|
|
54
|
-
import {EyePop} from '@eyepop.ai/eyepop'
|
|
73
|
+
import { EyePop } from '@eyepop.ai/eyepop'
|
|
55
74
|
|
|
56
75
|
const getSession = async function (req, res) {
|
|
57
|
-
const endpoint = await EyePop.workerEndpoint().connect()
|
|
58
|
-
res.setHeader(
|
|
59
|
-
res.writeHead(200)
|
|
60
|
-
res.end(JSON.stringify(await endpoint.session()))
|
|
61
|
-
}
|
|
62
|
-
const server = http.createServer(getSession)
|
|
63
|
-
server.listen(8080, '127.0.0.1')
|
|
76
|
+
const endpoint = await EyePop.workerEndpoint().connect()
|
|
77
|
+
res.setHeader('Content-Type', 'application/json')
|
|
78
|
+
res.writeHead(200)
|
|
79
|
+
res.end(JSON.stringify(await endpoint.session()))
|
|
80
|
+
}
|
|
81
|
+
const server = http.createServer(getSession)
|
|
82
|
+
server.listen(8080, '127.0.0.1')
|
|
64
83
|
```
|
|
84
|
+
|
|
65
85
|
#### Client Side
|
|
66
86
|
|
|
67
87
|
```javascript
|
|
68
|
-
import {EyePop} from '@eyepop.ai/eyepop'
|
|
88
|
+
import { EyePop } from '@eyepop.ai/eyepop'
|
|
69
89
|
|
|
70
|
-
(async () => {
|
|
71
|
-
const session = await (await fetch(
|
|
72
|
-
const endpoint = await EyePop.workerEndpoint({auth: {session: session}}).connect()
|
|
90
|
+
;(async () => {
|
|
91
|
+
const session = await (await fetch('http://127.0.0.1:8080')).json()
|
|
92
|
+
const endpoint = await EyePop.workerEndpoint({ auth: { session: session } }).connect()
|
|
73
93
|
// do work ....
|
|
74
|
-
await endpoint.disconnect()
|
|
75
|
-
})()
|
|
94
|
+
await endpoint.disconnect()
|
|
95
|
+
})()
|
|
76
96
|
```
|
|
97
|
+
|
|
77
98
|
### Authentication with Current Browser Session
|
|
78
99
|
|
|
79
100
|
```html
|
|
80
|
-
<!
|
|
101
|
+
<!doctype html>
|
|
81
102
|
<html lang="en">
|
|
82
|
-
<head>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</head>
|
|
86
|
-
<body>
|
|
87
|
-
<script>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</script>
|
|
94
|
-
</body>
|
|
103
|
+
<head>
|
|
104
|
+
<meta charset="UTF-8" />
|
|
105
|
+
<script src="https://cdn.jsdelivr.net/npm/@eyepop.ai/eyepop/dist/eyepop.min.js"></script>
|
|
106
|
+
</head>
|
|
107
|
+
<body>
|
|
108
|
+
<script>
|
|
109
|
+
document.addEventListener('DOMContentLoaded', async event => {
|
|
110
|
+
let endpoint = await EyePop.workerEndpoint({ auth: { oAuth2: true }, popId: '< Pop Id>' }).connect()
|
|
111
|
+
// do work ....
|
|
112
|
+
await endpoint.disconnect()
|
|
113
|
+
})
|
|
114
|
+
</script>
|
|
115
|
+
</body>
|
|
116
|
+
</html>
|
|
95
117
|
```
|
|
118
|
+
|
|
96
119
|
To use an alternative environment, e.g. STAGING vs PRODUCTION, pass in the adjusted Auth0 configuration:
|
|
97
120
|
|
|
98
121
|
```javascript
|
|
@@ -100,72 +123,83 @@ To use an alternative environment, e.g. STAGING vs PRODUCTION, pass in the adjus
|
|
|
100
123
|
let endpoint = await EyePop.workerEndpoint({
|
|
101
124
|
auth: {
|
|
102
125
|
oAuth2: {
|
|
103
|
-
audience:
|
|
104
|
-
domain:
|
|
105
|
-
clientId:
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
|
|
126
|
+
audience: 'https://dev-app.eyepop.ai',
|
|
127
|
+
domain: 'dev-eyepop.us.auth0.com',
|
|
128
|
+
clientId: 'jktx3YO2UnbkNPvr05PQWf26t1kNTJyg',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
popId: '< Pop Id>',
|
|
132
|
+
}).connect()
|
|
109
133
|
// ...
|
|
110
134
|
```
|
|
135
|
+
|
|
111
136
|
## Usage Examples
|
|
137
|
+
|
|
112
138
|
### Uploading and processing one single image
|
|
139
|
+
|
|
113
140
|
```typescript
|
|
114
141
|
import { EyePop } from '@eyepop.ai/eyepop'
|
|
115
142
|
|
|
116
|
-
const example_image_path = 'examples/example.jpg'
|
|
143
|
+
const example_image_path = 'examples/example.jpg'
|
|
117
144
|
|
|
118
|
-
(async() => {
|
|
145
|
+
;(async () => {
|
|
119
146
|
const endpoint = await EyePop.workerEndpoint().connect()
|
|
120
147
|
try {
|
|
121
|
-
let results = await endpoint.process({path: example_image_path})
|
|
148
|
+
let results = await endpoint.process({ path: example_image_path })
|
|
122
149
|
for await (let result of results) {
|
|
123
150
|
console.log(result)
|
|
124
|
-
}
|
|
151
|
+
}
|
|
125
152
|
} finally {
|
|
126
153
|
await endpoint.disconnect()
|
|
127
154
|
}
|
|
128
|
-
})()
|
|
155
|
+
})()
|
|
129
156
|
```
|
|
130
|
-
|
|
131
|
-
|
|
157
|
+
|
|
158
|
+
1. `EyePop.workerEndpoint()` returns a local endpoint object, that will authenticate with the Api Key found in
|
|
159
|
+
EYEPOP_SECRET_KEY and load the worker configuration for the Pop identified by EYEPOP_POP_ID.
|
|
132
160
|
2. Call `endpoint.connect()` before any job is submitted and `endpoint.disconnect()` to release all resources.
|
|
133
|
-
3. `endpoint.process({path:'examples/example.jpg'})` initiates the upload to the local file to the worker service.
|
|
134
|
-
The image will be queued and processed immediately when the worker becomes available.
|
|
135
|
-
The result of endpoint.upload() implements `AsyncIterable<Prediction>` which can be iterated with 'for await' as
|
|
136
|
-
shown in the example above. Predictions will become available when the submitted file becomes processed by the worker
|
|
137
|
-
and results are efficiently streamed back to the calling client. If the uploaded file is a video
|
|
138
|
-
e.g. 'video/mp4' or image container format e.g. 'image/gif', the client will receive one prediction per image frame
|
|
139
|
-
until the entire file has been processed.
|
|
161
|
+
3. `endpoint.process({path:'examples/example.jpg'})` initiates the upload to the local file to the worker service.
|
|
162
|
+
The image will be queued and processed immediately when the worker becomes available.
|
|
163
|
+
The result of endpoint.upload() implements `AsyncIterable<Prediction>` which can be iterated with 'for await' as
|
|
164
|
+
shown in the example above. Predictions will become available when the submitted file becomes processed by the worker
|
|
165
|
+
and results are efficiently streamed back to the calling client. If the uploaded file is a video
|
|
166
|
+
e.g. 'video/mp4' or image container format e.g. 'image/gif', the client will receive one prediction per image frame
|
|
167
|
+
until the entire file has been processed.
|
|
140
168
|
|
|
141
169
|
4. Alternatively to `path` process() also accepts a readable stream with a mandatory mime-type:
|
|
170
|
+
|
|
142
171
|
```typescript
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
172
|
+
// ...
|
|
173
|
+
let stream = fs.createReadStream(example_image_path)
|
|
174
|
+
endpoint.upload({ stream: readableStream, mimeType: 'image/jpeg' })
|
|
175
|
+
// ...
|
|
147
176
|
```
|
|
148
177
|
|
|
149
|
-
Note: since v0.21.0 `EyePop.workerEndpoint()` was introduced and replaces `EyePop.endpoint()` which is now deprecated.
|
|
178
|
+
Note: since v0.21.0 `EyePop.workerEndpoint()` was introduced and replaces `EyePop.endpoint()` which is now deprecated.
|
|
150
179
|
Support for `EyePop.endpoint()` will be removed in v1.0.0.
|
|
151
180
|
|
|
152
181
|
### Visualizing Results
|
|
182
|
+
|
|
153
183
|
Visualization components are provided as separate modules. Please refer to the module's documentation for usage examples.
|
|
154
|
-
|
|
184
|
+
|
|
185
|
+
- [EyePop Render 2d](https://www.npmjs.com/package/@eyepop.ai/eyepop-render-2d)
|
|
186
|
+
|
|
155
187
|
### Asynchronous uploading and processing of images
|
|
156
|
-
|
|
157
|
-
|
|
188
|
+
|
|
189
|
+
The above _synchronous_ way, process() then iterate all results, is great for individual images or reasonable
|
|
190
|
+
sized batches. For larger batch sizes, or continuous stream of images, don't `await` the results but instead
|
|
158
191
|
use `then()` on the returned promise.
|
|
192
|
+
|
|
159
193
|
```typescript
|
|
160
|
-
import { EyePop } from '@eyepop.ai/eyepop'
|
|
194
|
+
import { EyePop } from '@eyepop.ai/eyepop'
|
|
161
195
|
|
|
162
|
-
const example_image_path = 'examples/example.jpg'
|
|
196
|
+
const example_image_path = 'examples/example.jpg'
|
|
163
197
|
|
|
164
|
-
(async() => {
|
|
198
|
+
;(async () => {
|
|
165
199
|
const endpoint = await EyePop.workerEndpoint().connect()
|
|
166
200
|
try {
|
|
167
201
|
for (let i = 0; i < 100; i++) {
|
|
168
|
-
endpoint.process({path: example_image_path}).then(async
|
|
202
|
+
endpoint.process({ path: example_image_path }).then(async results => {
|
|
169
203
|
for await (let result of results) {
|
|
170
204
|
console.log(`result for #${i}`, result)
|
|
171
205
|
}
|
|
@@ -174,93 +208,105 @@ const example_image_path = 'examples/example.jpg';
|
|
|
174
208
|
} finally {
|
|
175
209
|
await endpoint.disconnect()
|
|
176
210
|
}
|
|
177
|
-
})()
|
|
211
|
+
})()
|
|
178
212
|
```
|
|
179
|
-
|
|
180
|
-
|
|
213
|
+
|
|
214
|
+
This will result in a most efficient processing, i.e. uploads will be processed in parallel (up to five HTTP
|
|
215
|
+
connections per endpoint) and results will be processed by your code as soon as they are available.
|
|
216
|
+
|
|
181
217
|
### Loading images from URLs
|
|
218
|
+
|
|
182
219
|
Alternatively to uploading files, you can also submit a publicly accessible URL for processing. Supported protocols are:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
220
|
+
|
|
221
|
+
- HTTP(s) URLs with response Content-Type image/_ or video/_
|
|
222
|
+
- RTSP (live-streaming)
|
|
223
|
+
- RTMP (live-streaming)
|
|
224
|
+
|
|
186
225
|
```typescript
|
|
187
|
-
import { EyePop } from '@eyepop.ai/eyepop'
|
|
226
|
+
import { EyePop } from '@eyepop.ai/eyepop'
|
|
188
227
|
|
|
189
|
-
const example_image_url = 'https://farm2.staticflickr.com/1080/1301049949_532835a8b5_z.jpg'
|
|
228
|
+
const example_image_url = 'https://farm2.staticflickr.com/1080/1301049949_532835a8b5_z.jpg'
|
|
190
229
|
|
|
191
|
-
(async() => {
|
|
230
|
+
;(async () => {
|
|
192
231
|
const endpoint = await EyePop.workerEndpoint().connect()
|
|
193
232
|
try {
|
|
194
|
-
let results = await endpoint.process({url: example_image_url})
|
|
233
|
+
let results = await endpoint.process({ url: example_image_url })
|
|
195
234
|
for await (let result of results) {
|
|
196
235
|
console.log(result)
|
|
197
|
-
}
|
|
236
|
+
}
|
|
198
237
|
} finally {
|
|
199
238
|
await endpoint.disconnect()
|
|
200
239
|
}
|
|
201
|
-
})()
|
|
240
|
+
})()
|
|
202
241
|
```
|
|
203
|
-
|
|
204
|
-
|
|
242
|
+
|
|
243
|
+
### Processing Videos
|
|
244
|
+
|
|
245
|
+
You can process videos via upload or public URLs. This example shows how to process all video frames of a file
|
|
205
246
|
retrieved from a public URL.
|
|
206
247
|
|
|
207
248
|
```typescript
|
|
208
249
|
import { EyePop } from '@eyepop.ai/eyepop'
|
|
209
250
|
|
|
210
|
-
const example_video_url = 'https://demo-eyepop-videos.s3.amazonaws.com/test1_vlog.mp4'
|
|
251
|
+
const example_video_url = 'https://demo-eyepop-videos.s3.amazonaws.com/test1_vlog.mp4'
|
|
211
252
|
|
|
212
|
-
(async() => {
|
|
253
|
+
;(async () => {
|
|
213
254
|
const endpoint = await EyePop.workerEndpoint().connect()
|
|
214
255
|
try {
|
|
215
|
-
let results = await endpoint.process({url: example_video_url})
|
|
256
|
+
let results = await endpoint.process({ url: example_video_url })
|
|
216
257
|
for await (let result of results) {
|
|
217
258
|
console.log(result)
|
|
218
|
-
}
|
|
259
|
+
}
|
|
219
260
|
} finally {
|
|
220
261
|
await endpoint.disconnect()
|
|
221
262
|
}
|
|
222
|
-
})()
|
|
263
|
+
})()
|
|
223
264
|
```
|
|
265
|
+
|
|
224
266
|
### Canceling Jobs
|
|
267
|
+
|
|
225
268
|
Any job that has been queued or is in-progress can be cancelled. E.g. stop the video processing after
|
|
226
269
|
predictions have been processed for 10 seconds duration of the video.
|
|
270
|
+
|
|
227
271
|
```typescript
|
|
228
272
|
import { EyePop } from '@eyepop.ai/eyepop'
|
|
229
273
|
|
|
230
|
-
const example_video_url = 'https://demo-eyepop-videos.s3.amazonaws.com/test1_vlog.mp4'
|
|
274
|
+
const example_video_url = 'https://demo-eyepop-videos.s3.amazonaws.com/test1_vlog.mp4'
|
|
231
275
|
|
|
232
|
-
(async() => {
|
|
276
|
+
;(async () => {
|
|
233
277
|
const endpoint = EyePop.workerEndpoint().connect()
|
|
234
278
|
try {
|
|
235
|
-
let results = await endpoint.process({url: example_video_url})
|
|
279
|
+
let results = await endpoint.process({ url: example_video_url })
|
|
236
280
|
for await (let result of results) {
|
|
237
281
|
console.log(result)
|
|
238
282
|
if (result['seconds'] >= 10.0) {
|
|
239
283
|
results.cancel()
|
|
240
284
|
}
|
|
241
|
-
}
|
|
285
|
+
}
|
|
242
286
|
} finally {
|
|
243
287
|
await endpoint.disconnect()
|
|
244
288
|
}
|
|
245
|
-
})()
|
|
289
|
+
})()
|
|
246
290
|
```
|
|
291
|
+
|
|
247
292
|
## Other Usage Options
|
|
293
|
+
|
|
248
294
|
#### Auto start workers
|
|
249
|
-
|
|
295
|
+
|
|
296
|
+
By default, `EyePop.workerEndpoint().connect()` will start a worker if none is running yet. To disable this behavior
|
|
250
297
|
create an endpoint with `EyePop.endpoint({autoStart: false})`.
|
|
298
|
+
|
|
251
299
|
#### Stop pending jobs
|
|
252
|
-
|
|
253
|
-
|
|
300
|
+
|
|
301
|
+
By default, `EyePop.workerEndpoint().connect()` will cancel all currently running or queued jobs on the worker.
|
|
302
|
+
It is assumed that the caller _takes full control_ of that worker. To disable this behavior create an endpoint with
|
|
254
303
|
`EyePop.endpoint({stopJobs: false})`.
|
|
255
304
|
|
|
256
305
|
## Data endpoint (PREVIEW)
|
|
306
|
+
|
|
257
307
|
To support managing your own datasets and control model optimization v0.21.0 introduces `EyePop.dataEndpoint()`,
|
|
258
308
|
an experimental pre-release which is subject to change. An officially supported version will be released with v2.0.0
|
|
259
309
|
|
|
260
310
|
## Composable Pops (PREVIEW)
|
|
261
|
-
See [Composable Pops](composable-pops.md) for a preview of client side composability of pops, introduced in v1.0.0.
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
311
|
|
|
312
|
+
See [Composable Pops](composable-pops.md) for a preview of client side composability of pops, introduced in v1.0.0.
|
package/dist/eyepop.index.d.mts
CHANGED
|
@@ -125,7 +125,13 @@ interface OAuth2Auth {
|
|
|
125
125
|
*/
|
|
126
126
|
oAuth2: true | Auth0Options;
|
|
127
127
|
}
|
|
128
|
-
|
|
128
|
+
interface LocalAuth {
|
|
129
|
+
/**
|
|
130
|
+
* Implicit auth w/o credentials to a local endpoint.
|
|
131
|
+
*/
|
|
132
|
+
isLocal: true;
|
|
133
|
+
}
|
|
134
|
+
type Authentication = undefined | SecretKeyAuth | SessionAuth | OAuth2Auth | LocalAuth;
|
|
129
135
|
interface Options {
|
|
130
136
|
auth?: Authentication | undefined;
|
|
131
137
|
/**
|
|
@@ -259,6 +265,7 @@ interface WorkerOptions extends Options {
|
|
|
259
265
|
isSandbox?: boolean;
|
|
260
266
|
autoStart?: boolean;
|
|
261
267
|
stopJobs?: boolean;
|
|
268
|
+
isLocalMode?: boolean;
|
|
262
269
|
}
|
|
263
270
|
|
|
264
271
|
interface WorkerSession extends Session {
|
|
@@ -266,6 +273,7 @@ interface WorkerSession extends Session {
|
|
|
266
273
|
readonly baseUrl: string | undefined;
|
|
267
274
|
readonly pipelineId: string | undefined;
|
|
268
275
|
readonly sandboxId: string | undefined;
|
|
276
|
+
authenticationHeaders(): any;
|
|
269
277
|
}
|
|
270
278
|
interface LiveMedia {
|
|
271
279
|
ingressId(): string;
|
|
@@ -274,7 +282,7 @@ interface LiveMedia {
|
|
|
274
282
|
}
|
|
275
283
|
interface IngressEvent {
|
|
276
284
|
readonly ingressId: string;
|
|
277
|
-
readonly event:
|
|
285
|
+
readonly event: 'stream-ready' | 'stream-ready';
|
|
278
286
|
}
|
|
279
287
|
interface FileSource {
|
|
280
288
|
readonly file: File;
|
|
@@ -393,6 +401,7 @@ declare enum ContourType {
|
|
|
393
401
|
}
|
|
394
402
|
interface ContourFinderComponent extends BaseComponent {
|
|
395
403
|
contourType: ContourType;
|
|
404
|
+
areaThreshold?: number;
|
|
396
405
|
}
|
|
397
406
|
interface ComponentFinderComponent extends BaseComponent {
|
|
398
407
|
dilate?: number;
|
|
@@ -426,6 +435,7 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
|
426
435
|
popName(): string | null;
|
|
427
436
|
pop(): Pop | null;
|
|
428
437
|
changePop(pop: Pop): Promise<void>;
|
|
438
|
+
private _authenticationHeaders;
|
|
429
439
|
/**
|
|
430
440
|
* @deprecated use pop() instead
|
|
431
441
|
*/
|
|
@@ -884,4 +894,4 @@ declare namespace EyePop {
|
|
|
884
894
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
885
895
|
}
|
|
886
896
|
|
|
887
|
-
export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type Contour, type ContourFinderComponent, ContourType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type Roi, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, type SourceParams, type SourcesEntry, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
|
|
897
|
+
export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type Contour, type ContourFinderComponent, ContourType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type LocalAuth, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type Roi, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, type SourceParams, type SourcesEntry, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
|
package/dist/eyepop.index.d.ts
CHANGED
|
@@ -125,7 +125,13 @@ interface OAuth2Auth {
|
|
|
125
125
|
*/
|
|
126
126
|
oAuth2: true | Auth0Options;
|
|
127
127
|
}
|
|
128
|
-
|
|
128
|
+
interface LocalAuth {
|
|
129
|
+
/**
|
|
130
|
+
* Implicit auth w/o credentials to a local endpoint.
|
|
131
|
+
*/
|
|
132
|
+
isLocal: true;
|
|
133
|
+
}
|
|
134
|
+
type Authentication = undefined | SecretKeyAuth | SessionAuth | OAuth2Auth | LocalAuth;
|
|
129
135
|
interface Options {
|
|
130
136
|
auth?: Authentication | undefined;
|
|
131
137
|
/**
|
|
@@ -259,6 +265,7 @@ interface WorkerOptions extends Options {
|
|
|
259
265
|
isSandbox?: boolean;
|
|
260
266
|
autoStart?: boolean;
|
|
261
267
|
stopJobs?: boolean;
|
|
268
|
+
isLocalMode?: boolean;
|
|
262
269
|
}
|
|
263
270
|
|
|
264
271
|
interface WorkerSession extends Session {
|
|
@@ -266,6 +273,7 @@ interface WorkerSession extends Session {
|
|
|
266
273
|
readonly baseUrl: string | undefined;
|
|
267
274
|
readonly pipelineId: string | undefined;
|
|
268
275
|
readonly sandboxId: string | undefined;
|
|
276
|
+
authenticationHeaders(): any;
|
|
269
277
|
}
|
|
270
278
|
interface LiveMedia {
|
|
271
279
|
ingressId(): string;
|
|
@@ -274,7 +282,7 @@ interface LiveMedia {
|
|
|
274
282
|
}
|
|
275
283
|
interface IngressEvent {
|
|
276
284
|
readonly ingressId: string;
|
|
277
|
-
readonly event:
|
|
285
|
+
readonly event: 'stream-ready' | 'stream-ready';
|
|
278
286
|
}
|
|
279
287
|
interface FileSource {
|
|
280
288
|
readonly file: File;
|
|
@@ -393,6 +401,7 @@ declare enum ContourType {
|
|
|
393
401
|
}
|
|
394
402
|
interface ContourFinderComponent extends BaseComponent {
|
|
395
403
|
contourType: ContourType;
|
|
404
|
+
areaThreshold?: number;
|
|
396
405
|
}
|
|
397
406
|
interface ComponentFinderComponent extends BaseComponent {
|
|
398
407
|
dilate?: number;
|
|
@@ -426,6 +435,7 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
|
426
435
|
popName(): string | null;
|
|
427
436
|
pop(): Pop | null;
|
|
428
437
|
changePop(pop: Pop): Promise<void>;
|
|
438
|
+
private _authenticationHeaders;
|
|
429
439
|
/**
|
|
430
440
|
* @deprecated use pop() instead
|
|
431
441
|
*/
|
|
@@ -884,4 +894,4 @@ declare namespace EyePop {
|
|
|
884
894
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
885
895
|
}
|
|
886
896
|
|
|
887
|
-
export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type Contour, type ContourFinderComponent, ContourType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type Roi, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, type SourceParams, type SourcesEntry, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
|
|
897
|
+
export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type Contour, type ContourFinderComponent, ContourType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, type FileSource, type ForwardComponent, ForwardOperatorType, type InferenceComponent, InferenceType, type IngressEvent, type LiveMedia, type LiveSource, LoadFromJob, LoadLiveIngressJob, type LocalAuth, type Mask, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelInstanceDef, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type Roi, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, type SourceParams, type SourcesEntry, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, EyePop as default };
|