A powerful/faster C++ model for NSFW detection, based on nsfwjs
If you only need the NSFW detection code, copy-paste nsfwcpp.h (header only) and model.onnx into your project, and install the requirements.
Here is a simple API to run the model:
- Requirements: Conan 2.x, CMake 3.x
- How to Install:
- Run
conan install . --build=missing - Then
cmake --preset conan-default - Then
cmake --build build --config Release
- Run
To start, run ./path/to/nsfwcpp. The API will be available on http://0.0.0.0:8080. You can change this in drogon_config.json if you want.
- Method: POST
- Content-Type: multipart/form-data
- Field: file
curl -X POST http://0.0.0.0:8080 \
-F "file=@/file.txt"