tensorflow-helpers
Version:
Helper functions to use tensorflow in nodejs for transfer learning, image classification, and more
32 lines (31 loc) • 1.02 kB
TypeScript
import './polyfill';
import * as tf from '@tensorflow/tfjs-node';
import { CropAndResizeAspectRatio } from './image-utils';
export { getImageTensorShape, Box, calcCropBox, CropAndResizeAspectRatio, cropAndResizeImageTensor, } from './image-utils';
export declare function loadImageFile(file: string, options?: {
channels?: number;
dtype?: string;
expandAnimations?: false;
crop?: {
width: number;
height: number;
aspectRatio?: CropAndResizeAspectRatio;
};
}): Promise<tf.Tensor3D>;
export declare function loadImageFile(file: string, options?: {
channels?: number;
dtype?: string;
expandAnimations?: boolean;
crop?: {
width: number;
height: number;
aspectRatio?: CropAndResizeAspectRatio;
};
}): Promise<tf.Tensor3D | tf.Tensor4D>;
export declare function cropAndResizeImageFile(options: {
srcFile: string;
destFile: string;
width: number;
height: number;
aspectRatio?: CropAndResizeAspectRatio;
}): Promise<void>;