Comments (3)
Even the example code doesn't work.
const axios = require('axios') //you can use any http client
const tf = require('@tensorflow/tfjs-node')
const nsfw = require('nsfwjs')
async function fn() {
const pic = await axios.get('xxx.img', {
responseType: 'arraybuffer',
})
const url = "file://" + __dirname + "/min_nsfwjs/model.json";
const model = await nsfw.load(url, { size: 299 });
// Image must be in tf.tensor3d format
// you can convert image to tf.tensor3d with tf.node.decodeImage(Uint8Array,channels)
const image = await tf.node.decodeImage(pic.data,3)
const predictions = await model.classify(image)
image.dispose() // Tensor memory must be managed explicitly (it is not sufficient to let a tf.Tensor go out of scope for its memory to be released).
console.log(predictions)
}
fn()
The kernel 'Transpose' for backend 'webgl' is already registered
The kernel 'Unique' for backend 'webgl' is already registered
The kernel 'Unpack' for backend 'webgl' is already registered
The kernel 'UnsortedSegmentSum' for backend 'webgl' is already registered
The kernel 'ZerosLike' for backend 'webgl' is already registered
node:internal/deps/undici/undici:11600
Error.captureStackTrace(err, this);
^
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11600:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: Error: not implemented... yet...
at makeNetworkError (node:internal/deps/undici/undici:6911:35)
at schemeFetch (node:internal/deps/undici/undici:11050:18)
at node:internal/deps/undici/undici:10930:26
at mainFetch (node:internal/deps/undici/undici:10947:11)
at fetching (node:internal/deps/undici/undici:10904:7)
at fetch2 (node:internal/deps/undici/undici:10782:20)
at Object.fetch (node:internal/deps/undici/undici:11598:18)
at fetch (node:internal/process/pre_execution:274:25)
at PlatformNode.fetch (C:\Users\remot\Documents\resenderbottg\node_modules\@tensorflow\tfjs-core\dist\tf-core.node.js:7425:33)
at HTTPRequest.<anonymous> (C:\Users\remot\Documents\resenderbottg\node_modules\@tensorflow\tfjs-core\dist\tf-core.node.js:8289:55)
}
Node.js v20.7.0
from nsfwjs.
@danekbiglike, can you help me to install thetensorflow/tfjs-node
?
npm i tensorflow/tfjs-node
couldn't find.
from nsfwjs.
@hubsMIT1, it's npm i @tensorflow/tfjs-node
from nsfwjs.
Related Issues (20)
- [False Positive]: a little bit funny HOT 2
- Which model is the best atm? Resources hardware is not a problem. inception_v4?
- I really need to run this locally for batch processing local images any guides tutorials? HOT 2
- How to use the Inception V3 model in the npm package?
- when adding a frame to an nsfw picture...
- Problem detecting adult content from camera images
- Cant import nsfw in react Project HOT 2
- Logs spammed by tfjs-node launched twice
- The accuracy is much less than the site HOT 1
- Broken with the recent file on next.js HOT 4
- Error connecting to cloudfront.net since this morning HOT 12
- Publish to npm out of sync HOT 3
- `console.warn` when `BASE_PATH` is used on load
- Remove GIF Support HOT 1
- False Positive HOT 1
- type: "graph" vs size: 299 HOT 1
- Mismatch in the published package content. HOT 1
- MobileNetV2Mid doesn't load HOT 3
- NSFW through Docker reports an error - maybe provide Docker support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsfwjs.