# nsfw-classifier **Repository Path**: ryanvan2000/nsfw-classifier ## Basic Information - **Project Name**: nsfw-classifier - **Description**: No description available - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-03 - **Last Updated**: 2026-03-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

GitHub release

GitHub last commit GitHub issues GitHub pull requests GitHub forks GitHub stars
Contributors ESLint LICENSE GitHub tweet


This repository is dedicated for building a classifier to detect NSFW Images & Videos. # Table of Contents - [Installation](#installation) - [Usage](#usage) - [Development](#development) - [License](#license) ## Installation [(Back to Top)](#table-of-contents) To use this project, first clone the repo on your device using the command given below: ```git init``` ```git clone https://github.com/LaxmanSinghTomar/nsfw-classifier.git``` ## Usage [(Back to Top)](#table-of-contents) Install the required libraries & packages using: ```sh pip install requirements.txt ``` To download the dataset upon which the model was trained run: ```sh python src/scripts/data.sh ``` If run successfully, this should create a directory ```data``` in the project directory. To run a quick demo using an image and a video run: ```sh python src/scripts/inference.sh ``` To identify whether an image contains NSFW content or not using the default model run: ```sh python src/inference/inference_image.py [img-path] ``` To identify whether a video is NSFW or not using the default model run: ```sh python src/inference/inference_video.py [video-path] ``` Output Video is saved in the ```output``` directory. **Note:** The default trained model is MobileNetv2 which is smaller in size due to which loads quickly and is good for inference. ## Development [(Back to Top)](#table-of-contents)
.
├── LICENSE
├── models                         <- Trained and Serialized Models
├── notebooks                      <- Jupyter Notebook
├── NSFW Classifier.png
├── output                         <- Output for Videos
├── README.md
├── references                     <- Reference Materials to understand Approaches & Solutions
├── reports                        <- Reports & Figures Generated
│   ├── figures
├── requirements.txt               <- Requirements File for reproducing the analysis environment 
└── src
    ├── config.py                  <- Script for Configuration like File Paths, default Model
    ├── inference                  <- Scripts for running an inference on either image/video using trained model
    │   ├── inference_image.py
    │   └── inference_video.py
    ├── models                     <- Scripts to train the ML Models
    │   ├── efficientnet.py
    │   ├── mobilenet.py
    │   └── nasnetmobile.py
    ├── scripts                    <- Scripts to download dataset and run inference on an image/video for Demo
    │   ├── data.sh
    │   └── inference.sh
    └── visualizations             <- Scripts to create exploratory and results oriented visualizations
        └── visualizations.py
If you wish to change the default model for predictions i.e. MobileNetv2, change ```MODEL_PATH``` in ```src/config.py``` to the either of the models available in ```models``` directory. ## License [(Back to top)](#table-of-contents) [GNU General Public License version 3](https://opensource.org/licenses/GPL-3.0)