UNPKG

react-native-fast-tflite

Version:

High-performance TensorFlow Lite library for React Native, built with Nitro Modules

18 lines 1.1 kB
import type { TfliteModel, TensorflowModelDelegate } from './specs/Tflite.nitro'; type Require = number; export type ModelSource = Require | { url: string; }; /** * Load a Tensorflow Lite Model from the given `.tflite` asset. * * * If you are passing in a `.tflite` model from your app's bundle using `require(..)`, make sure to add `tflite` as an asset extension to `metro.config.js`! * * If you are passing in a `{ url: ... }`, make sure the URL points directly to a `.tflite` model. This can either be a web URL (`http://..`/`https://..`), or a local file (`file://..`). * * @param source The `.tflite` model in form of either a `require(..)` statement or a `{ url: string }`. * @param delegates The delegates to use for computations. Uses the standard CPU delegate per default. The `core-ml` or `metal` delegates are GPU-accelerated, but don't work on every model. * @returns The loaded Model. */ export declare function loadTensorflowModel(source: ModelSource, delegates: TensorflowModelDelegate[]): Promise<TfliteModel>; export {}; //# sourceMappingURL=loadTensorflowModel.d.ts.map