Giter VIP home page Giter VIP logo

nsfwjs-docker's Introduction

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. You can find it on the Docker Hub here. Created for my social network app, Rybun

Installation ⚙️

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
      }
    ]
  ]
}

nsfwjs-docker's People

Contributors

andresribeiro avatar arnidan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nsfwjs-docker's Issues

Illegal instruction - ELIFECYCLE  Command failed with exit code 132.

When I run the container using the same command defined in the README...

docker run -p 3333:3333 -d --name nsfwjs andresribeiroo/nsfwjs:1.6

...we can see the following error:

2024-05-06 15:31:16 
2024-05-06 15:31:16 > [email protected] start /app
2024-05-06 15:31:16 > node dist/server.js
2024-05-06 15:31:16 
2024-05-06 15:31:18 Illegal instruction
2024-05-06 15:31:18  ELIFECYCLE  Command failed with exit code 132.

Any ideas?

Screenshot 2024-05-06 at 15 33 42

Empty reply from server

After I posted a jpg file by curl like this,
curl -F "[email protected]" "http://localhost:3333/single/multipart-form"
I got the replay
curl: (52) Empty reply from server
And then the server app has been terminated.

Illegal instruction (core dumped)

I cloned the project and did the normal installation without errors. however, after trying to start the project with npm start, this error simply appears in the console.

any solution tips?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.