Skip to main content

An AI powered nudity detection library

Project description

Overview

newd analyzes images and identifies specific NSFW body parts with high accuracy. It can also optionally censor detected areas.

Installation

pip install newd

Usage

Basic Detection

from newd import detect

# Standard detection with default settings
results = detect('path/to/image.jpg')
print(results)

Advanced Options

# Faster detection with slightly reduced accuracy
results = detect('image.jpg', mode="fast")

# Adjust detection sensitivity
results = detect('image.jpg', min_prob=0.3)  # Lower threshold catches more potential matches

# Combine options
results = detect('image.jpg', mode="fast", min_prob=0.3)

Compatible Input Types

The detect() function accepts:

  • String file paths
  • Images loaded with OpenCV (cv2)
  • Images loaded with PIL/Pillow

Output Format

Detection results are returned as a list of dictionaries:

[
  {
    'box': [x1, y1, x2, y2],  # Bounding box coordinates (top-left, bottom-right)
    'score': 0.825,           # Confidence score (0-1)
    'label': 'EXPOSED_BREAST_F'  # Classification label
  },
  # Additional detections...
]

First-Time Use

When importing newd for the first time, it will download a 139MB model file to your home directory (~/.newd/). This happens only once.

Performance Notes

  • Standard mode: Best accuracy, normal processing speed
  • Fast mode: ~3x faster processing with slightly reduced accuracy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newd-0.0.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

newd-0.0.3-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file newd-0.0.3.tar.gz.

File metadata

  • Download URL: newd-0.0.3.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for newd-0.0.3.tar.gz
Algorithm Hash digest
SHA256 2a778daaef1ec6752b64a474619bbce7a2fb71dcff02e255d51415e1dfe5162b
MD5 5dd559e3e376e8401f4ad05404c9c750
BLAKE2b-256 9ebfc504a21e0e011f6468540dd230a5d4c3f8fd1e229aff0f4e41138a4e24ff

See more details on using hashes here.

File details

Details for the file newd-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: newd-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for newd-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 94c7635c6baf7fc13ef5604ec3e71535f17a152e65234e014876202c1382dd01
MD5 0e24f0f7b5fc14fc4ed90522493f23fb
BLAKE2b-256 3297ff4159af109902b74f70f28e80154260dbb0321daf9001349a7962efa8b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page