Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amirzenoozi/nsfw-classification
A Simple NSFW Classifier Based on Keras and Tensorflow
https://github.com/amirzenoozi/nsfw-classification
cli keras-models keras-tensorflow nsfw nsfw-classifier-api nsfw-detection nsfw-recognition nudity nudity-detection porn-detection rest-api scene-detection sexy telegram-bot telegram-bots uvicorn
Last synced: about 1 month ago
JSON representation
A Simple NSFW Classifier Based on Keras and Tensorflow
- Host: GitHub
- URL: https://github.com/amirzenoozi/nsfw-classification
- Owner: amirzenoozi
- License: agpl-3.0
- Created: 2022-03-23T10:34:11.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T10:54:25.000Z (9 months ago)
- Last Synced: 2024-09-27T01:50:46.104Z (3 months ago)
- Topics: cli, keras-models, keras-tensorflow, nsfw, nsfw-classifier-api, nsfw-detection, nsfw-recognition, nudity, nudity-detection, porn-detection, rest-api, scene-detection, sexy, telegram-bot, telegram-bots, uvicorn
- Language: Python
- Homepage:
- Size: 321 KB
- Stars: 56
- Watchers: 7
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# NSFW Classification ⛔
![](https://github.com/amirzenoozi/nsfw-classification/blob/main/main.png)
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:
```bash
Illegal instruction (core dumped)
```
### Requirements 📦```bash
pip install -r requirements.txt
```## Classifier CLI Options 📋
```bash
--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
```bash
python main.py --dir PATH_TO_YOUR_DIR --model MODEL_FILE --jsob FOLDER_NAME
```## Frame Extractor CLI Options 📋
```bash
--frame Frame Threshold #default: 1800 (Every Minutes)
--src Video File PATH #default: 'sample.mp4'
```Then You Just Need To Run This
```bash
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:
```bash
python bot.py
```## Rest API 📡
You Only Need To Run:
```bash
uvicorn server:app
```## Features ✨
- [x] Detect `Neutral` , `Porn` and `Sexy`
- [x] CLI
- [x] Telegram Bot
- [x] Video Files
- [x] Auto Scene Detect
- [ ] Train Phase
- [ ] Dataset
- [ ] Rest API
- [x] Image Support
- [ ] Video Support
- [ ] GIF Support