landingai
TypeScript icon, indicating that this package has built-in type declarations

1.0.24 • Public • Published

landingai

Core functions for getting predictions from LandingLens cloud deployment endpoints and rendering predictions.

npm install landingai
# OR
yarn add landingai

Usage

Getting prediction results

// 1. setup endpoint and credentials
const apiInfo = {
  endpoint: "https://predict.app.landing.ai/inference/v1/predict?endpoint_id=<endpoint_id>",
  key: "<api_key>",
  secret: "<api_secret>",
}
// 2. get an image and convert to blob
const blob = await fetch("url-to-image").then((response) => response.blob());
// 3. get predictions from the blob
const { backbonepredictions } = await getInferenceResult(apiInfo, blob);
// 4. convert to annotations for rendering
const annotations = predictionsToAnnotations(backbonepredictions);
// render annotations

References

Readme

Keywords

none

Package Sidebar

Install

npm i landingai

Weekly Downloads

197

Version

1.0.24

License

MIT

Unpacked Size

60.6 kB

Total Files

18

Last publish

Collaborators

  • tian.lan