Skip to content

joyou-io/nsfwjs-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NSFWJS Server Logo

NSFW web server via NSFWJS

Features

  • ℹ️ Return predictions for Neutral, Drawing, Sexy, Hentai and Porn
  • 🎯 Pretty accurate (~93%)
  • 🖼️ Supports jpg / png / gif / webp image formats

Installation

  • npm i

Start

  • node main.js

  • or node main.js 9000

    web server running at port 9016(default)

Usage

POST request to Content-Type: multipart/form-data sending an image in the image field
  • image binary

    curl -X POST localhost:9016/upload -F 'image=@./draw1.jpg'

  • image path

    curl -X POST localhost:9016/upload -F 'image=draw1.jpg'

  • image url

    curl -X POST localhost:9016/upload -F 'https://xxx.com/draw1.jpg'

Response

  • only code : 0 and data.isSafe : true means a "good" image!

  • { "code": 0, "msg": "bad image!", "data": { "isSafe": false, "imgType": "Porn", "predictions": [ { "className": "Porn", "probability": 0.6056722402572632 }, { "className": "Sexy", "probability": 0.3434692621231079 }, { "className": "Hentai", "probability": 0.030655445531010628 }, { "className": "Neutral", "probability": 0.017868373543024063 }, { "className": "Drawing", "probability": 0.0023346678353846073 } ] } }

Releases

No releases published

Packages

No packages published