Node
Call EyePop from Node, the browser, and React Native
The EyePop Node SDK calls the inference and data APIs from TypeScript or JavaScript. Install it, set an API key, and run a Pop against an image, video, or stream.
npm install --save @eyepop.ai/eyepop<script src="https://cdn.jsdelivr.net/npm/@eyepop.ai/eyepop/dist/eyepop.min.js"></script>npm install --save @eyepop.ai/react-native-eyepop \
react-native-canvas react-native-file-access@3.1.1 \
react-native-tcp-socket react-native-webrtcYour first prediction
import { EyePop, PopComponentType } from '@eyepop.ai/eyepop'
const endpoint = await EyePop.workerEndpoint({
pop: {
components: [
{ type: PopComponentType.INFERENCE, ability: 'eyepop.person:latest' },
],
},
}).connect()
try {
const results = await endpoint.process({ source: { path: 'image.jpg' } })
for await (const result of results) {
console.log(result)
}
} finally {
await endpoint.disconnect()
}process() resolves to a ResultStream, an AsyncIterable of predictions. An image normally produces one; a video or animated container produces one per frame.
Pass the Pop when you create the endpoint so EyePop can schedule the right compute before any media is processed.
Next steps
Configuration — credentials and session options
Running Inference — files, streams, URLs, and image groups
Composable Pops — chain models into a pipeline
Visualization — draw predictions on a canvas
Last updated
