@eyepop.ai/eyepop 0.12.0 → 0.14.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 +15 -5
- package/dist/eyepop.min.js +1 -1
- package/dist/index.d.mts +31 -20
- package/dist/index.d.ts +31 -20
- package/dist/index.js +463 -296
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +463 -296
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ The EyePop.ai Node SDK provides convenient access to the EyePop.ai's inference A
|
|
|
3
3
|
TypeScript or JavaScript language.
|
|
4
4
|
## Installation
|
|
5
5
|
```shell
|
|
6
|
-
npm install --save eyepop
|
|
6
|
+
npm install --save @eyepop.ai/eyepop
|
|
7
7
|
```
|
|
8
8
|
## Configuration
|
|
9
9
|
The EyePop SDK needs to be configured with the __Pop Id__ and your __Authentication Credentials__. Credentials can
|
|
@@ -37,8 +37,7 @@ Equivalent, but shorter:
|
|
|
37
37
|
```typescript
|
|
38
38
|
import { EyePopSdk } from '@eyepop.ai/eyepop'
|
|
39
39
|
(async() => {
|
|
40
|
-
const endpoint = EyePopSdk.endpoint()
|
|
41
|
-
await endpoint.connect()
|
|
40
|
+
const endpoint = await EyePopSdk.endpoint().connect()
|
|
42
41
|
// do work ....
|
|
43
42
|
await endpoint.disconnect()
|
|
44
43
|
})
|
|
@@ -77,13 +76,24 @@ import { EyePopSdk } from '@eyepop.ai/eyepop'
|
|
|
77
76
|
<body>
|
|
78
77
|
<script>
|
|
79
78
|
document.addEventListener("DOMContentLoaded", async (event) => {
|
|
80
|
-
let endpoint = await EyePopSdk.endpoint({ auth: {
|
|
79
|
+
let endpoint = await EyePopSdk.endpoint({ auth: { oAuth2: true }, popId: '< Pop Id>' }).connect();
|
|
81
80
|
// do work ....
|
|
82
81
|
await endpoint.disconnect();
|
|
83
82
|
});
|
|
84
83
|
</script>
|
|
85
84
|
</body>
|
|
86
85
|
```
|
|
86
|
+
To use an alternative environment, e.g. STAGING vs PRODUCTION, pass in the adjusted Auth0 configuration:
|
|
87
|
+
```javascript
|
|
88
|
+
// ...
|
|
89
|
+
let endpoint = await EyePopSdk.endpoint({
|
|
90
|
+
auth: { oAuth2: {
|
|
91
|
+
audience: "https://dev-app.eyepop.ai",
|
|
92
|
+
domain: "dev-eyepop.us.auth0.com",
|
|
93
|
+
clientId: "jktx3YO2UnbkNPvr05PQWf26t1kNTJyg"
|
|
94
|
+
} }, popId: '< Pop Id>' }).connect();
|
|
95
|
+
// ...
|
|
96
|
+
```
|
|
87
97
|
## Usage Examples
|
|
88
98
|
### Uploading and processing one single image
|
|
89
99
|
```typescript
|
|
@@ -108,7 +118,7 @@ EYEPOP_SECRET_KEY and load the worker configuration for the Pop identified by EY
|
|
|
108
118
|
2. Call `endpoint.connect()` before any job is submitted and `endpoint.disconnect()` to release all resources.
|
|
109
119
|
3. `endpoint.process({path:'examples/example.jpg'})` initiates the upload to the local file to the worker service.
|
|
110
120
|
The image will be queued and processed immediately when the worker becomes available.
|
|
111
|
-
The result of endpoint.upload() implements `AsyncIterable<Prediction>` which can be iterated
|
|
121
|
+
The result of endpoint.upload() implements `AsyncIterable<Prediction>` which can be iterated with 'for await' as
|
|
112
122
|
shown in the example above. Predictions will become available when the submitted file becomes processed by the worker
|
|
113
123
|
and results are efficiently streamed back to the calling client. If the uploaded file is a video
|
|
114
124
|
e.g. 'video/mp4' or image container format e.g. 'image/gif', the client will receive one prediction per image frame
|