Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/holzmaster/docker-nsfwjs
https://github.com/holzmaster/docker-nsfwjs
hacktoberfest
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/holzmaster/docker-nsfwjs
- Owner: holzmaster
- License: mit
- Created: 2023-05-03T13:56:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-01T13:24:40.000Z (4 months ago)
- Last Synced: 2024-08-01T16:17:03.198Z (4 months ago)
- Topics: hacktoberfest
- Language: TypeScript
- Homepage:
- Size: 3.9 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-nsfwjs
### 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). Hard-fork of [andresribeiro/nsfwjs-docker](https://github.com/andresribeiro/nsfwjs-docker), which has the following goals:
- More standard tooling (npm instead of pnpm, no git hooks, tsc instead of swc)
- Slimmer deployment image + repo (models not in repo, more stages in docker build)### Installation âī¸
```shell
docker run -p 8080:8080 -d --name nsfwjs ghcr.io/holzmaster/nsfwjs:latest
```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 `/classify` sending an image in the `content` field:
```sh
curl -XPOST -F "content=@/path/to/file" http://localhost:8080/classify
```
Example result:
```json
{
"prediction": {
"neutral": 0.9992233514785767,
"drawing": 0.0006749277818016708,
"porn": 0.00004637416350306012,
"sexy": 0.000037574754969682544,
"hentai": 0.000017801607100409456
}
}
```