Metadata-Version: 2.4
Name: newd
Version: 0.0.3
Summary: An AI powered nudity detection library
Home-page: https://github.com/s0md3v/newd
Author: Somdev Sangwan
Author-email: s0md3v@gmail.com
License: GPLv3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6.0
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: pillow
Requires-Dist: opencv-python-headless>=4.5.1.48
Requires-Dist: tqdm
Requires-Dist: scikit-image
Requires-Dist: onnxruntime
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary


## Overview

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

## Installation

```bash
pip install newd
```

## Usage

### Basic Detection

```python
from newd import detect

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

### Advanced Options

```python
# 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:

```python
[
  {
    '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



