UNPKG

tensorflow-helpers

Version:

Helper functions to use tensorflow in nodejs for transfer learning, image classification, and more

18 lines (17 loc) 691 B
import { ModelArtifacts, ModelJSON } from '@tensorflow/tfjs-core/dist/io/types'; export type PatchedModelArtifacts = ModelJSON & Pick<ModelArtifacts, 'weightData' | 'weightSpecs'> & { userDefinedMetadata?: { classNames?: string[]; }; }; export type ModelWithArtifacts<Model extends object> = Model & { artifacts: PatchedModelArtifacts; }; export declare function getModelArtifacts<Model extends object>(_model: Model): PatchedModelArtifacts; /** * wrapper to unify the LayeredModel and GraphModel */ export declare function exposeModelArtifacts<Model extends object>(model: Model): Model & { getArtifacts: () => PatchedModelArtifacts; classNames?: string[]; };