1.1.0 • Published 5 years ago

tfjs-indexeddb-helpers v1.1.0

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

Tensorflow.js IndexedDB Helpers

Allows users to store big tensorflow.js models on the client-side within the indexedDB.

Installation

npm install --save tfjs-indexeddb-helpers

Usage

loadAndStoreLayersModel(url: String, id: String)

To not make 2 requests to load a model, only use the loader in this package. Once the model gets loaded it will also get stored in the IndexedDB.

import { loadAndStoreLayersModel } from 'tfjs-indexeddb-helpers';

const modelArtifacts = await loadAndStoreLayersModel('https://foo.com/model.json', 'foo');

loadFromIndexedDb(id: String)

import { loadFromIndexedDb } from 'tfjs-indexeddb-helpers';

const modelArtifacts = await loadFromIndexedDb('foo');