amirzenoozi / nsfw-classification

A Simple NSFW Classifier Based on Keras and Tensorflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NSFW Classification β›”

We Use Pretrained Keras Model to Classify NSFW Content

Prequisites

To run bot you need CPU that supports AVX or AVX2 to run last versions of Tensorflow Otherwise you'll see output like this in your console:

Illegal instruction (core dumped)

Requirements πŸ“¦

pip install -r requirements.txt

Classifier CLI Options πŸ“‹

--model     Model File Path                 #default: 'model/model.h5'
--dir       Directory Path To Classify      #default: 'data/frames'
--json      Json File Path                  #default: 'data/frames'

Then You Just Need To Run This

python main.py --dir PATH_TO_YOUR_DIR --model MODEL_FILE --jsob FOLDER_NAME

Frame Extractor CLI Options πŸ“‹

--frame     Frame Threshold     #default: 1800 (Every Minutes)
--src       Video File PATH     #default: 'sample.mp4'

Then You Just Need To Run This

python frame.py --frame FRAME_TH --src VIDEO_FILE

How To Serve Telegram Bot πŸ€–

Firstly, You Need To Get API_TOKEN from @Bot_Father. Then you need to put your token into '.env' file. Now just run:

python bot.py

Rest API πŸ“‘

You Only Need To Run:

uvicorn server:app

Features ✨

  • Detect Neutral , Porn and Sexy
  • CLI
  • Telegram Bot
  • Video Files
  • Auto Scene Detect
  • Train Phase
  • Dataset
  • Rest API
    • Image Support
    • Video Support
    • GIF Support

About

A Simple NSFW Classifier Based on Keras and Tensorflow

License:GNU Affero General Public License v3.0


Languages

Language:Python 100.0%