@eyepop.ai/eyepop 1.9.2 → 1.11.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 -107
- package/dist/eyepop.index.d.mts +37 -6
- package/dist/eyepop.index.d.ts +37 -6
- package/dist/eyepop.index.js +288 -229
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +286 -229
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/dist/eyepop.min.js.LICENSE.txt +0 -9
- package/package.json +45 -43
package/README.md
CHANGED
|
@@ -1,98 +1,120 @@
|
|
|
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'
|
|
69
|
-
|
|
70
|
-
(
|
|
71
|
-
const
|
|
72
|
-
const endpoint = await EyePop.workerEndpoint({auth: {session: session}}).connect();
|
|
88
|
+
import { EyePop } from '@eyepop.ai/eyepop'
|
|
89
|
+
;(async () => {
|
|
90
|
+
const session = await (await fetch('http://127.0.0.1:8080')).json()
|
|
91
|
+
const endpoint = await EyePop.workerEndpoint({ auth: { session: session } }).connect()
|
|
73
92
|
// do work ....
|
|
74
|
-
await endpoint.disconnect()
|
|
75
|
-
})()
|
|
93
|
+
await endpoint.disconnect()
|
|
94
|
+
})()
|
|
76
95
|
```
|
|
96
|
+
|
|
77
97
|
### Authentication with Current Browser Session
|
|
78
98
|
|
|
79
99
|
```html
|
|
80
|
-
<!
|
|
100
|
+
<!doctype html>
|
|
81
101
|
<html lang="en">
|
|
82
|
-
<head>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</head>
|
|
86
|
-
<body>
|
|
87
|
-
<script>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</script>
|
|
94
|
-
</body>
|
|
102
|
+
<head>
|
|
103
|
+
<meta charset="UTF-8" />
|
|
104
|
+
<script src="https://cdn.jsdelivr.net/npm/@eyepop.ai/eyepop/dist/eyepop.min.js"></script>
|
|
105
|
+
</head>
|
|
106
|
+
<body>
|
|
107
|
+
<script>
|
|
108
|
+
document.addEventListener('DOMContentLoaded', async event => {
|
|
109
|
+
let endpoint = await EyePop.workerEndpoint({ auth: { oAuth2: true }, popId: '< Pop Id>' }).connect()
|
|
110
|
+
// do work ....
|
|
111
|
+
await endpoint.disconnect()
|
|
112
|
+
})
|
|
113
|
+
</script>
|
|
114
|
+
</body>
|
|
115
|
+
</html>
|
|
95
116
|
```
|
|
117
|
+
|
|
96
118
|
To use an alternative environment, e.g. STAGING vs PRODUCTION, pass in the adjusted Auth0 configuration:
|
|
97
119
|
|
|
98
120
|
```javascript
|
|
@@ -100,72 +122,83 @@ To use an alternative environment, e.g. STAGING vs PRODUCTION, pass in the adjus
|
|
|
100
122
|
let endpoint = await EyePop.workerEndpoint({
|
|
101
123
|
auth: {
|
|
102
124
|
oAuth2: {
|
|
103
|
-
audience:
|
|
104
|
-
domain:
|
|
105
|
-
clientId:
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
|
|
125
|
+
audience: 'https://dev-app.eyepop.ai',
|
|
126
|
+
domain: 'dev-eyepop.us.auth0.com',
|
|
127
|
+
clientId: 'jktx3YO2UnbkNPvr05PQWf26t1kNTJyg',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
popId: '< Pop Id>',
|
|
131
|
+
}).connect()
|
|
109
132
|
// ...
|
|
110
133
|
```
|
|
134
|
+
|
|
111
135
|
## Usage Examples
|
|
136
|
+
|
|
112
137
|
### Uploading and processing one single image
|
|
138
|
+
|
|
113
139
|
```typescript
|
|
114
140
|
import { EyePop } from '@eyepop.ai/eyepop'
|
|
115
141
|
|
|
116
|
-
const example_image_path = 'examples/example.jpg'
|
|
142
|
+
const example_image_path = 'examples/example.jpg'
|
|
117
143
|
|
|
118
|
-
(async() => {
|
|
144
|
+
;(async () => {
|
|
119
145
|
const endpoint = await EyePop.workerEndpoint().connect()
|
|
120
146
|
try {
|
|
121
|
-
let results = await endpoint.process({path: example_image_path})
|
|
147
|
+
let results = await endpoint.process({ path: example_image_path })
|
|
122
148
|
for await (let result of results) {
|
|
123
149
|
console.log(result)
|
|
124
|
-
}
|
|
150
|
+
}
|
|
125
151
|
} finally {
|
|
126
152
|
await endpoint.disconnect()
|
|
127
153
|
}
|
|
128
|
-
})()
|
|
154
|
+
})()
|
|
129
155
|
```
|
|
130
|
-
|
|
131
|
-
|
|
156
|
+
|
|
157
|
+
1. `EyePop.workerEndpoint()` returns a local endpoint object, that will authenticate with the Api Key found in
|
|
158
|
+
EYEPOP_SECRET_KEY and load the worker configuration for the Pop identified by EYEPOP_POP_ID.
|
|
132
159
|
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.
|
|
160
|
+
3. `endpoint.process({path:'examples/example.jpg'})` initiates the upload to the local file to the worker service.
|
|
161
|
+
The image will be queued and processed immediately when the worker becomes available.
|
|
162
|
+
The result of endpoint.upload() implements `AsyncIterable<Prediction>` which can be iterated with 'for await' as
|
|
163
|
+
shown in the example above. Predictions will become available when the submitted file becomes processed by the worker
|
|
164
|
+
and results are efficiently streamed back to the calling client. If the uploaded file is a video
|
|
165
|
+
e.g. 'video/mp4' or image container format e.g. 'image/gif', the client will receive one prediction per image frame
|
|
166
|
+
until the entire file has been processed.
|
|
140
167
|
|
|
141
168
|
4. Alternatively to `path` process() also accepts a readable stream with a mandatory mime-type:
|
|
169
|
+
|
|
142
170
|
```typescript
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
171
|
+
// ...
|
|
172
|
+
let stream = fs.createReadStream(example_image_path)
|
|
173
|
+
endpoint.upload({ stream: readableStream, mimeType: 'image/jpeg' })
|
|
174
|
+
// ...
|
|
147
175
|
```
|
|
148
176
|
|
|
149
|
-
Note: since v0.21.0 `EyePop.workerEndpoint()` was introduced and replaces `EyePop.endpoint()` which is now deprecated.
|
|
177
|
+
Note: since v0.21.0 `EyePop.workerEndpoint()` was introduced and replaces `EyePop.endpoint()` which is now deprecated.
|
|
150
178
|
Support for `EyePop.endpoint()` will be removed in v1.0.0.
|
|
151
179
|
|
|
152
180
|
### Visualizing Results
|
|
181
|
+
|
|
153
182
|
Visualization components are provided as separate modules. Please refer to the module's documentation for usage examples.
|
|
154
|
-
|
|
183
|
+
|
|
184
|
+
- [EyePop Render 2d](https://www.npmjs.com/package/@eyepop.ai/eyepop-render-2d)
|
|
185
|
+
|
|
155
186
|
### Asynchronous uploading and processing of images
|
|
156
|
-
|
|
157
|
-
|
|
187
|
+
|
|
188
|
+
The above _synchronous_ way, process() then iterate all results, is great for individual images or reasonable
|
|
189
|
+
sized batches. For larger batch sizes, or continuous stream of images, don't `await` the results but instead
|
|
158
190
|
use `then()` on the returned promise.
|
|
191
|
+
|
|
159
192
|
```typescript
|
|
160
|
-
import { EyePop } from '@eyepop.ai/eyepop'
|
|
193
|
+
import { EyePop } from '@eyepop.ai/eyepop'
|
|
161
194
|
|
|
162
|
-
const example_image_path = 'examples/example.jpg'
|
|
195
|
+
const example_image_path = 'examples/example.jpg'
|
|
163
196
|
|
|
164
|
-
(async() => {
|
|
197
|
+
;(async () => {
|
|
165
198
|
const endpoint = await EyePop.workerEndpoint().connect()
|
|
166
199
|
try {
|
|
167
200
|
for (let i = 0; i < 100; i++) {
|
|
168
|
-
endpoint.process({path: example_image_path}).then(async
|
|
201
|
+
endpoint.process({ path: example_image_path }).then(async results => {
|
|
169
202
|
for await (let result of results) {
|
|
170
203
|
console.log(`result for #${i}`, result)
|
|
171
204
|
}
|
|
@@ -174,93 +207,105 @@ const example_image_path = 'examples/example.jpg';
|
|
|
174
207
|
} finally {
|
|
175
208
|
await endpoint.disconnect()
|
|
176
209
|
}
|
|
177
|
-
})()
|
|
210
|
+
})()
|
|
178
211
|
```
|
|
179
|
-
|
|
180
|
-
|
|
212
|
+
|
|
213
|
+
This will result in a most efficient processing, i.e. uploads will be processed in parallel (up to five HTTP
|
|
214
|
+
connections per endpoint) and results will be processed by your code as soon as they are available.
|
|
215
|
+
|
|
181
216
|
### Loading images from URLs
|
|
217
|
+
|
|
182
218
|
Alternatively to uploading files, you can also submit a publicly accessible URL for processing. Supported protocols are:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
219
|
+
|
|
220
|
+
- HTTP(s) URLs with response Content-Type image/_ or video/_
|
|
221
|
+
- RTSP (live-streaming)
|
|
222
|
+
- RTMP (live-streaming)
|
|
223
|
+
|
|
186
224
|
```typescript
|
|
187
|
-
import { EyePop } from '@eyepop.ai/eyepop'
|
|
225
|
+
import { EyePop } from '@eyepop.ai/eyepop'
|
|
188
226
|
|
|
189
|
-
const example_image_url = 'https://farm2.staticflickr.com/1080/1301049949_532835a8b5_z.jpg'
|
|
227
|
+
const example_image_url = 'https://farm2.staticflickr.com/1080/1301049949_532835a8b5_z.jpg'
|
|
190
228
|
|
|
191
|
-
(async() => {
|
|
229
|
+
;(async () => {
|
|
192
230
|
const endpoint = await EyePop.workerEndpoint().connect()
|
|
193
231
|
try {
|
|
194
|
-
let results = await endpoint.process({url: example_image_url})
|
|
232
|
+
let results = await endpoint.process({ url: example_image_url })
|
|
195
233
|
for await (let result of results) {
|
|
196
234
|
console.log(result)
|
|
197
|
-
}
|
|
235
|
+
}
|
|
198
236
|
} finally {
|
|
199
237
|
await endpoint.disconnect()
|
|
200
238
|
}
|
|
201
|
-
})()
|
|
239
|
+
})()
|
|
202
240
|
```
|
|
203
|
-
|
|
204
|
-
|
|
241
|
+
|
|
242
|
+
### Processing Videos
|
|
243
|
+
|
|
244
|
+
You can process videos via upload or public URLs. This example shows how to process all video frames of a file
|
|
205
245
|
retrieved from a public URL.
|
|
206
246
|
|
|
207
247
|
```typescript
|
|
208
248
|
import { EyePop } from '@eyepop.ai/eyepop'
|
|
209
249
|
|
|
210
|
-
const example_video_url = 'https://demo-eyepop-videos.s3.amazonaws.com/test1_vlog.mp4'
|
|
250
|
+
const example_video_url = 'https://demo-eyepop-videos.s3.amazonaws.com/test1_vlog.mp4'
|
|
211
251
|
|
|
212
|
-
(async() => {
|
|
252
|
+
;(async () => {
|
|
213
253
|
const endpoint = await EyePop.workerEndpoint().connect()
|
|
214
254
|
try {
|
|
215
|
-
let results = await endpoint.process({url: example_video_url})
|
|
255
|
+
let results = await endpoint.process({ url: example_video_url })
|
|
216
256
|
for await (let result of results) {
|
|
217
257
|
console.log(result)
|
|
218
|
-
}
|
|
258
|
+
}
|
|
219
259
|
} finally {
|
|
220
260
|
await endpoint.disconnect()
|
|
221
261
|
}
|
|
222
|
-
})()
|
|
262
|
+
})()
|
|
223
263
|
```
|
|
264
|
+
|
|
224
265
|
### Canceling Jobs
|
|
266
|
+
|
|
225
267
|
Any job that has been queued or is in-progress can be cancelled. E.g. stop the video processing after
|
|
226
268
|
predictions have been processed for 10 seconds duration of the video.
|
|
269
|
+
|
|
227
270
|
```typescript
|
|
228
271
|
import { EyePop } from '@eyepop.ai/eyepop'
|
|
229
272
|
|
|
230
|
-
const example_video_url = 'https://demo-eyepop-videos.s3.amazonaws.com/test1_vlog.mp4'
|
|
273
|
+
const example_video_url = 'https://demo-eyepop-videos.s3.amazonaws.com/test1_vlog.mp4'
|
|
231
274
|
|
|
232
|
-
(async() => {
|
|
275
|
+
;(async () => {
|
|
233
276
|
const endpoint = EyePop.workerEndpoint().connect()
|
|
234
277
|
try {
|
|
235
|
-
let results = await endpoint.process({url: example_video_url})
|
|
278
|
+
let results = await endpoint.process({ url: example_video_url })
|
|
236
279
|
for await (let result of results) {
|
|
237
280
|
console.log(result)
|
|
238
281
|
if (result['seconds'] >= 10.0) {
|
|
239
282
|
results.cancel()
|
|
240
283
|
}
|
|
241
|
-
}
|
|
284
|
+
}
|
|
242
285
|
} finally {
|
|
243
286
|
await endpoint.disconnect()
|
|
244
287
|
}
|
|
245
|
-
})()
|
|
288
|
+
})()
|
|
246
289
|
```
|
|
290
|
+
|
|
247
291
|
## Other Usage Options
|
|
292
|
+
|
|
248
293
|
#### Auto start workers
|
|
249
|
-
|
|
294
|
+
|
|
295
|
+
By default, `EyePop.workerEndpoint().connect()` will start a worker if none is running yet. To disable this behavior
|
|
250
296
|
create an endpoint with `EyePop.endpoint({autoStart: false})`.
|
|
297
|
+
|
|
251
298
|
#### Stop pending jobs
|
|
252
|
-
|
|
253
|
-
|
|
299
|
+
|
|
300
|
+
By default, `EyePop.workerEndpoint().connect()` will cancel all currently running or queued jobs on the worker.
|
|
301
|
+
It is assumed that the caller _takes full control_ of that worker. To disable this behavior create an endpoint with
|
|
254
302
|
`EyePop.endpoint({stopJobs: false})`.
|
|
255
303
|
|
|
256
304
|
## Data endpoint (PREVIEW)
|
|
305
|
+
|
|
257
306
|
To support managing your own datasets and control model optimization v0.21.0 introduces `EyePop.dataEndpoint()`,
|
|
258
307
|
an experimental pre-release which is subject to change. An officially supported version will be released with v2.0.0
|
|
259
308
|
|
|
260
309
|
## 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
310
|
|
|
311
|
+
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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Logger } from 'pino';
|
|
2
|
-
import { Prediction as Prediction$1 } from '@eyepop.ai/eyepop';
|
|
3
2
|
|
|
4
3
|
interface Session {
|
|
5
4
|
readonly eyepopUrl: string;
|
|
@@ -125,7 +124,13 @@ interface OAuth2Auth {
|
|
|
125
124
|
*/
|
|
126
125
|
oAuth2: true | Auth0Options;
|
|
127
126
|
}
|
|
128
|
-
|
|
127
|
+
interface LocalAuth {
|
|
128
|
+
/**
|
|
129
|
+
* Implicit auth w/o credentials to a local endpoint.
|
|
130
|
+
*/
|
|
131
|
+
isLocal: true;
|
|
132
|
+
}
|
|
133
|
+
type Authentication = undefined | SecretKeyAuth | SessionAuth | OAuth2Auth | LocalAuth;
|
|
129
134
|
interface Options {
|
|
130
135
|
auth?: Authentication | undefined;
|
|
131
136
|
/**
|
|
@@ -259,6 +264,7 @@ interface WorkerOptions extends Options {
|
|
|
259
264
|
isSandbox?: boolean;
|
|
260
265
|
autoStart?: boolean;
|
|
261
266
|
stopJobs?: boolean;
|
|
267
|
+
isLocalMode?: boolean;
|
|
262
268
|
}
|
|
263
269
|
|
|
264
270
|
interface WorkerSession extends Session {
|
|
@@ -266,6 +272,7 @@ interface WorkerSession extends Session {
|
|
|
266
272
|
readonly baseUrl: string | undefined;
|
|
267
273
|
readonly pipelineId: string | undefined;
|
|
268
274
|
readonly sandboxId: string | undefined;
|
|
275
|
+
authenticationHeaders(): any;
|
|
269
276
|
}
|
|
270
277
|
interface LiveMedia {
|
|
271
278
|
ingressId(): string;
|
|
@@ -274,7 +281,7 @@ interface LiveMedia {
|
|
|
274
281
|
}
|
|
275
282
|
interface IngressEvent {
|
|
276
283
|
readonly ingressId: string;
|
|
277
|
-
readonly event:
|
|
284
|
+
readonly event: 'stream-ready' | 'stream-ready';
|
|
278
285
|
}
|
|
279
286
|
interface FileSource {
|
|
280
287
|
readonly file: File;
|
|
@@ -393,6 +400,7 @@ declare enum ContourType {
|
|
|
393
400
|
}
|
|
394
401
|
interface ContourFinderComponent extends BaseComponent {
|
|
395
402
|
contourType: ContourType;
|
|
403
|
+
areaThreshold?: number;
|
|
396
404
|
}
|
|
397
405
|
interface ComponentFinderComponent extends BaseComponent {
|
|
398
406
|
dilate?: number;
|
|
@@ -426,6 +434,7 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
|
426
434
|
popName(): string | null;
|
|
427
435
|
pop(): Pop | null;
|
|
428
436
|
changePop(pop: Pop): Promise<void>;
|
|
437
|
+
private _authenticationHeaders;
|
|
429
438
|
/**
|
|
430
439
|
* @deprecated use pop() instead
|
|
431
440
|
*/
|
|
@@ -549,9 +558,21 @@ declare enum UserReview {
|
|
|
549
558
|
rejected = "rejected",
|
|
550
559
|
unknown = "unknown"
|
|
551
560
|
}
|
|
561
|
+
interface AutoAnnotatePrompt {
|
|
562
|
+
prompt: string;
|
|
563
|
+
label: string;
|
|
564
|
+
}
|
|
565
|
+
declare enum AutoAnnotateTask {
|
|
566
|
+
object_detection = "object_detection",
|
|
567
|
+
image_classification = "image_classification"
|
|
568
|
+
}
|
|
552
569
|
interface AutoAnnotateParams {
|
|
570
|
+
/**
|
|
571
|
+
* @deprecated use prompts instead
|
|
572
|
+
*/
|
|
553
573
|
candidate_labels?: string[];
|
|
554
|
-
|
|
574
|
+
prompts?: AutoAnnotatePrompt[];
|
|
575
|
+
task?: AutoAnnotateTask;
|
|
555
576
|
confidence_threshold?: number;
|
|
556
577
|
}
|
|
557
578
|
interface Annotation {
|
|
@@ -590,6 +611,10 @@ interface Asset {
|
|
|
590
611
|
declare enum ModelType {
|
|
591
612
|
epdet_b1 = "epdet_b1"
|
|
592
613
|
}
|
|
614
|
+
declare enum ModelTask {
|
|
615
|
+
object_detection = "object_detection",
|
|
616
|
+
image_classification = "image_classification"
|
|
617
|
+
}
|
|
593
618
|
declare enum ModelStatus {
|
|
594
619
|
error = "error",
|
|
595
620
|
draft = "draft",
|
|
@@ -631,6 +656,8 @@ interface Model {
|
|
|
631
656
|
external_id?: string;
|
|
632
657
|
pretrained_model_uuid?: string;
|
|
633
658
|
extra_params?: Map<string, any>;
|
|
659
|
+
task?: ModelTask;
|
|
660
|
+
classes?: string[];
|
|
634
661
|
type: ModelType;
|
|
635
662
|
status: ModelStatus;
|
|
636
663
|
status_message?: string;
|
|
@@ -648,11 +675,15 @@ interface ModelCreate {
|
|
|
648
675
|
external_id?: string;
|
|
649
676
|
pretrained_model_uuid?: string;
|
|
650
677
|
extra_params?: Map<string, any>;
|
|
678
|
+
task?: ModelTask;
|
|
679
|
+
classes?: string[];
|
|
651
680
|
}
|
|
652
681
|
interface ModelUpdate {
|
|
653
682
|
name: string;
|
|
654
683
|
description: string;
|
|
655
684
|
external_id?: string;
|
|
685
|
+
task?: ModelTask;
|
|
686
|
+
classes?: string[];
|
|
656
687
|
}
|
|
657
688
|
declare enum ModelTrainingStage {
|
|
658
689
|
waiting = "waiting",
|
|
@@ -732,7 +763,7 @@ declare class DataEndpoint extends Endpoint<DataEndpoint> {
|
|
|
732
763
|
getAsset(asset_uuid: string, dataset_uuid?: string, dataset_version?: number, include_annotations?: boolean, top_k?: number): Promise<Asset>;
|
|
733
764
|
deleteAsset(asset_uuid: string, dataset_uuid?: string, dataset_version?: number): Promise<void>;
|
|
734
765
|
resurrectAsset(asset_uuid: string, dataset_uuid: string, from_dataset_version: number, into_dataset_version?: number): Promise<void>;
|
|
735
|
-
updateAssetGroundTruth(asset_uuid: string, dataset_uuid?: string, dataset_version?: number, prediction?: Prediction
|
|
766
|
+
updateAssetGroundTruth(asset_uuid: string, dataset_uuid?: string, dataset_version?: number, prediction?: Prediction): Promise<void>;
|
|
736
767
|
deleteAssetGroundTruth(asset_uuid: string, dataset_uuid?: string, dataset_version?: number): Promise<void>;
|
|
737
768
|
updateAutoAnnotationStatus(asset_uuid: string, auto_annotate: string, user_review: UserReview, approved_threshold?: number): Promise<void>;
|
|
738
769
|
downloadAsset(asset_uuid: string, dataset_uuid?: string, dataset_version?: number, transcode_mode?: TranscodeMode): Promise<Blob>;
|
|
@@ -884,4 +915,4 @@ declare namespace EyePop {
|
|
|
884
915
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
885
916
|
}
|
|
886
917
|
|
|
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 };
|
|
918
|
+
export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type Auth0Options, type Authentication, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateTask, 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, ModelTask, 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 };
|