nsfwjs-node
Advanced tools
Comparing version 2.1.10 to 2.1.11
@@ -17,3 +17,3 @@ import * as tf from '@tensorflow/tfjs-node'; | ||
} | ||
export declare function load(base?: string, options?: { | ||
export declare function load(options?: { | ||
size: number; | ||
@@ -20,0 +20,0 @@ }): Promise<NSFWJS>; |
10
index.js
@@ -47,9 +47,8 @@ "use strict"; | ||
__export(require("./read")); | ||
var BASE_PATH = 'https://s3.amazonaws.com/ir_public/nsfwjscdn/TFJS_nsfw_mobilenet/tfjs_quant_nsfw_mobilenet/'; | ||
var BASE_PATH = require('path').resolve(__dirname, '../model/') + '/model.json'; | ||
var IMAGE_SIZE = 224; | ||
function load(base, options) { | ||
if (base === void 0) { base = BASE_PATH; } | ||
function load(options) { | ||
if (options === void 0) { options = { size: IMAGE_SIZE }; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var nsfwnet; | ||
var handler, nsfwnet; | ||
return __generator(this, function (_a) { | ||
@@ -62,3 +61,4 @@ switch (_a.label) { | ||
} | ||
nsfwnet = new NSFWJS(base, options); | ||
handler = tf.io.fileSystem(BASE_PATH); | ||
nsfwnet = new NSFWJS(handler, options); | ||
return [4, nsfwnet.load()]; | ||
@@ -65,0 +65,0 @@ case 1: |
{ | ||
"name": "nsfwjs-node", | ||
"version": "2.1.10", | ||
"version": "2.1.11", | ||
"description": "Detect NSFW content client side", | ||
@@ -19,8 +19,8 @@ "main": "index.js", | ||
"@tensorflow/tfjs-node": "1.1.2", | ||
"libgif": "0.0.2", | ||
"jpeg-js": "^0.3.4" | ||
"jpeg-js": "^0.3.7", | ||
"libgif": "0.0.2" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^24.0.6", | ||
"all-contributors-cli": "^6.1.2", | ||
"@types/jest": "^24.9.1", | ||
"all-contributors-cli": "^6.13.0", | ||
"babel-core": "^6.26.0", | ||
@@ -31,9 +31,9 @@ "babel-plugin-transform-runtime": "~6.23.0", | ||
"node-fetch": "^2.3.0", | ||
"np": "^5.0.0", | ||
"np": "^5.2.1", | ||
"seedrandom": "~3.0.3", | ||
"ts-jest": "^24.0.0", | ||
"ts-jest": "^24.3.0", | ||
"ts-node": "~8.4.1", | ||
"tslint": "~5.20.0", | ||
"tslint": "^5.20.1", | ||
"typescript": "3.6.3", | ||
"uglify-js": "^3.6.0" | ||
"uglify-js": "^3.7.7" | ||
}, | ||
@@ -40,0 +40,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
37330
Updatedjpeg-js@^0.3.7