Khrisna commited on
Commit
a8b15f5
·
1 Parent(s): e30d518

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -2
index.js CHANGED
@@ -341,8 +341,8 @@ async function check_nsfw(buffer) {
341
  // you can convert image to tf.tensor3d with tf.node.decodeImage(Uint8Array,channels)
342
  const image = await tfjs.node.decodeImage(buffer,3)
343
  const predictions = await model.classify(image)
344
- 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).
345
- cosnt results = prediction.map(v => {
346
  return {
347
  class_name: v.className,
348
  probability: v.probability,
 
341
  // you can convert image to tf.tensor3d with tf.node.decodeImage(Uint8Array,channels)
342
  const image = await tfjs.node.decodeImage(buffer,3)
343
  const predictions = await model.classify(image)
344
+ image.dispose();
345
+ const results = prediction.map(v => {
346
  return {
347
  class_name: v.className,
348
  probability: v.probability,