1.0.18 • Published 11 months ago

@landingai/react v1.0.18

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@landingai/react

React components to fetch and render predictions from an image.

Usage

import React from 'react';
import { useState } from "react";
import { InferenceContext, InferenceResult, PhotoCollector } from "@landingai/react";

const apiInfo = {
  endpoint: `https://predict.app.landing.ai/inference/v1/predict?endpoint_id=<endpoint_id>`,
  key: "<api_key>",
  secret: "<api_secret>",
};

export default function App() {
  const [image, setImage] = useState<Blob>();

  return (
    <InferenceContext.Provider value={apiInfo}>
      <PhotoCollector setImage={setImage} />
      <InferenceResult image={image} />
    </InferenceContext.Provider>
  );
}

References

Examples

1.0.18

11 months ago