# Nudity Detection API
This project implements a nudity detection API using Python, Flask, and the nudenet library. The API allows you to upload an image and detect nudity in it. If nudity is detected, the API applies a blur effect to the nudity regions.
## Installation
1. Clone the repository:
```shell
git clone <repository_url>
-
Install the required dependencies:
pip install -r requirements.txt
-
Start the Flask server:
python api.py
-
The API is now running locally at
http://localhost:5000
.
POST /detect
: Upload an image file with the keyimage
to detect nudity. The API will return a JSON response containing thenudity_detected
flag and the processed image.
curl -X POST -F "image=@/path/to/image.jpg" http://localhost:5000/detect
The project structure is as follows:
main.py
: Entry point for running the code locally with machine's camera setup.api.py
: Entry point for running the API.camera.py
: Module for interacting with the camera and capturing frames.nude_detector.py
: Module encapsulating the nudity detection functionality using the nudenet library.utils/
: Directory containing utility modules for image processing and blur effect.utils/image_processing.py
: Module for loading and processing images.utils/blur.py
: Module for applying blur effect to specific image regions.requirements.txt
: List of required libraries and dependencies.README.md
: This file, providing project documentation.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.
Feel free to customize the README.md file according to your specific project details and requirements.