GithubHelp home page GithubHelp logo

nudity-detection's Introduction

# 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>
  1. Install the required dependencies:

    pip install -r requirements.txt

Usage

Run the API

  1. Start the Flask server:

    python api.py
  2. The API is now running locally at http://localhost:5000.

API Endpoint

  • POST /detect: Upload an image file with the key image to detect nudity. The API will return a JSON response containing the nudity_detected flag and the processed image.

Example

curl -X POST -F "image=@/path/to/image.jpg" http://localhost:5000/detect

Project Structure

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.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.


Feel free to customize the README.md file according to your specific project details and requirements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.