![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
imagine-client-js
Advanced tools
This library allows you to easily connect to doc.ai's Imagine API.
Model Id | Type | Description |
---|---|---|
phenomenal-face | image | Given a facial image, this model infers the age, sex, height and weight of a person |
happy-face | image | Given a facial image, this model infers the mood of a person |
client.getImageModel(modelId)
Given a string (modelId), gets the image model. See the "Supported Image Models" section for a list of supported model ids
imageModel.infer(fsReadStream, shouldStoreImage, metadata)
Performs the model's inference on an image. A read stream should be passed as the parameter (fsReadStream).
imageModel.inferByType(data, type, shouldStoreImage, metadata)
Performs the model's inference on an image. A data should be passed as the parameter (data) and type should specify the format that the data is in. (base64 is currently supported)
imageModel.correctionLabel(correctionObj, metadata)
Uploads a correction label to the imagine API, for a given inference.
imageModel.predictionLabel(correctionObj, metadata)
(FOR EDGE PREDICTIONS) Uploads a prediction label to the imagine API, for a given inference.
const fs = require('fs');
const ImagineClient = require('imagine-client-nodejs');
// Initialize imagine client
const client = new ImagineClient({
apiKey: '1234567890',
clientId: '3ad839e3-90e7-4564-b3a1-5e39c88545a5'
});
// Get a reference to the 'happy-face' model
const model = client.getImageModel('happy-face');
// Create a read stream to a image file
const imageStream = fs.createReadStream('face.png');
// Perform the model's inference, on the image.
return model.infer(imageStream, false)
.then((result) => {
// Print the result
console.log(result);
});
FAQs
A Nodejs client for doc.ai's Imagine API
The npm package imagine-client-js receives a total of 0 weekly downloads. As such, imagine-client-js popularity was classified as not popular.
We found that imagine-client-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.