Metadata-Version: 2.4
Name: nsfw_image_detector
Version: 0.1.1
Summary: A powerful NSFW content detection library using EVA-based vision transformer
Home-page: https://github.com/freepik-company/nsfw_image_detector
Author: Freepik
Author-email: info@freepik.com
Keywords: nsfw,image-detection,content-filtering,vision-transformer,ai,machine-learning
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.0.0
Requires-Dist: transformers>=4.30.0
Requires-Dist: Pillow>=9.0.0
Requires-Dist: timm>=0.6.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# NSFW Image Detector

A Python library that provides easy-to-use interfaces for NSFW (Not Safe For Work) image detection using an EVA-based vision transformer model published on Hugging Face: See the model details in [Model card](https://huggingface.co/Freepik/nsfw_test).

## Installation

You can install this library via pip. The package is available in [PyPI](https://pypi.org/project/nsfw-image-detector/)

```bash
pip install nsfw_image_detector
```

## Quick Usage

```python
from PIL import Image
from nsfw_image_detector import NSFWDetector

# Initialize the detector
detector = NSFWDetector()

# Load and classify an image
image = Image.open("path/to/your/image.jpg")

# Check if the image contains NSFW content
is_nsfw = detector.is_nsfw(image)
print(f"Is NSFW: {is_nsfw}")

# Get probability scores for all categories
probabilities = detector.predict_proba(image)
print(probabilities)
```

## License

Apache License 2.0
