UNPKG

nsfwjs-api

Version:
44 lines (43 loc) 1.2 kB
import { type NSFWJS } from 'nsfwjs'; declare class nsfwjsApi { /** * @description: 模型位置 默认运行文件夹下model, UseModel为false时无效 * @return {*} */ model: string; /** * @description: 是否使用本地模型 默认false * @return {*} */ UseModel: boolean; /** * @description: 返回的结果数(默认全部为 5) * @return {*} */ topk?: number; modelLoad?: NSFWJS; constructor(); /** * @description: copy模型文件夹, UseModel为false时无效 模型文件 https://github.com/infinitered/nsfwjs/tree/master/models/inception_v3 * @return {void} */ cpModel(): void; /** * @description: 鉴图 * @param {string} image 图片地址 可以是 https | http | 图片路径 |Buffer * @return {*} */ identificationOfPictures(image: string | Buffer): Promise<{ code: number; msg: string; } | { code: number; msg: { code: number; msg: string; } | import("nsfwjs").predictionType[]; }>; load(): Promise<NSFWJS>; } declare const _default: nsfwjsApi; export = _default;