Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andresribeiro/nsfwjs-docker
A Docker REST API for NSFW detection
https://github.com/andresribeiro/nsfwjs-docker
docker nodejs nsfw nsfwjs rest-api tensorflow tensorflowjs typescript
Last synced: about 3 hours ago
JSON representation
A Docker REST API for NSFW detection
- Host: GitHub
- URL: https://github.com/andresribeiro/nsfwjs-docker
- Owner: andresribeiro
- License: mit
- Created: 2021-05-16T17:38:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-27T17:55:43.000Z (11 months ago)
- Last Synced: 2023-12-27T18:47:35.775Z (11 months ago)
- Topics: docker, nodejs, nsfw, nsfwjs, rest-api, tensorflow, tensorflowjs, typescript
- Language: TypeScript
- Homepage:
- Size: 18.3 MB
- Stars: 37
- Watchers: 1
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nsfwjs-docker
### Features â¨
- âšī¸ Return predictions for `Neutral`, `Drawing`, `Sexy`, `Hentai` and `Porn`
- đ¯ Pretty accurate (~93%)
- đŧī¸ Supports different image formats
- ⥠250ms to make predictions to a single image### About đī¸
A Docker REST API for NSFW detection with [NSFWJS](https://github.com/infinitered/nsfwjs). You can find it on the Docker Hub [here](https://hub.docker.com/r/andresribeiroo/nsfwjs). Created for my social network app, [Rybun](https://rybun.com)
### Installation âī¸
```shell
docker run -p 3333:3333 -d --name nsfwjs andresribeiroo/nsfwjs:1.6
```If you are deploying in production, you will probably want to pass the `--restart always` flag to start the container whenever the server restarts
### Usage đ¨
#### One image, multipart/form-data
`POST` request to `/single/multipart-form` sending an image in the `content` field
```
{
"prediction": [
{
"className": "Neutral",
"probability": 0.6371303796768188
},
{
"className": "Drawing",
"probability": 0.3603636920452118
},
{
"className": "Hentai",
"probability": 0.0024505197070538998
},
{
"className": "Sexy",
"probability": 0.00003775714503717609
},
{
"className": "Porn",
"probability": 0.000017730137187754735
}
]
}
```#### Multiple images, multipart/form-data
`POST` request to `/multiple/multipart-form` sending images in the `contents` field
```
{
"predictions": [
[
{
"className": "Neutral",
"probability": 0.6371303796768188
},
{
"className": "Drawing",
"probability": 0.3603636920452118
},
{
"className": "Hentai",
"probability": 0.0024505197070538998
},
{
"className": "Sexy",
"probability": 0.00003775714503717609
},
{
"className": "Porn",
"probability": 0.000017730137187754735
}
],
[
{
"className": "Neutral",
"probability": 0.9498893618583679
},
{
"className": "Drawing",
"probability": 0.04626458138227463
},
{
"className": "Hentai",
"probability": 0.00267870188690722
},
{
"className": "Sexy",
"probability": 0.0008198379655368626
},
{
"className": "Porn",
"probability": 0.0003475486591923982
}
]
]
}
```