@nsfwspy/node
Version:
A nudity/pornography image classifier built for Node.js.
26 lines • 903 B
TypeScript
/// <reference types="node" />
import * as tfjs from '@tensorflow/tfjs';
export declare class NsfwSpy {
private imageSize;
private modelPath;
private model;
constructor(modelPath: string);
load(loadOptions?: tfjs.io.LoadOptions): Promise<void>;
classifyImageFromByteArray(imageBuffer: Buffer): Promise<NsfwSpyResult>;
classifyImageFile(filePath: string): Promise<NsfwSpyResult>;
}
export declare class NsfwSpyResult {
hentai: number;
neutral: number;
pornography: number;
sexy: number;
predictedLabel: ClassificationTypes;
constructor(results: Uint8Array | Float32Array | Int32Array);
get isNsfw(): boolean;
toDictionary(): {
key: ClassificationTypes;
value: number;
}[];
}
export declare type ClassificationTypes = "hentai" | "neutral" | "pornography" | "sexy";
//# sourceMappingURL=index.d.ts.map