Skip to content

seanghay/nsfwjs-server

Repository files navigation

NSFW detection

A Docker image with nsfwjs, TensorFlow.js and Express server.

Run the server

  1. Using Docker Container
docker run -it --rm -p "127.0.0.1:8080:8080" ghcr.io/seanghay/nsfwjs-server:latest
  1. Using Docker Compose
docker-compose up -d

Request

curl --request POST http://localhost:8080/ \
  --header 'Content-Type: multipart/form-data' \
  --form 'file=@image.jpg'

Response

an example

[
	{
		"className": "Neutral",
		"probability": 0.7651876211166382
	},
	{
		"className": "Drawing",
		"probability": 0.22617404162883759
	},
	{
		"className": "Sexy",
		"probability": 0.0067122685723006725
	},
	{
		"className": "P*rn",
		"probability": 0.001053938060067594
	},
	{
		"className": "H*ntai",
		"probability": 0.000872117409016937
	}
]