A powerful NSFW content detection library using EVA-based vision transformer
Project description
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.
Installation
You can install this library via pip. The package is available in PyPI
pip install nsfw_image_detector
Quick Usage
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nsfw_image_detector-0.1.2.tar.gz.
File metadata
- Download URL: nsfw_image_detector-0.1.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f8e453a0f7d70b3d065979a8f9649dae9e965e8661fbc3fe330e317cbe7809f
|
|
| MD5 |
cdf48c7c65cbc0676c298075c5f9e75f
|
|
| BLAKE2b-256 |
5553913dc9b6c001e4e85b2c36c1468fd89a624f259b642a64a1d264b8fe7411
|
File details
Details for the file nsfw_image_detector-0.1.2-py3-none-any.whl.
File metadata
- Download URL: nsfw_image_detector-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0802ff0891861c18d91489117c96c08b8732c42d513da814816407cc8f088c4
|
|
| MD5 |
a599f3b7e45b2974de815d4dfaae536b
|
|
| BLAKE2b-256 |
e7885b8db6c7a5b8d9d237657e1aa55760db01279c5334630b0d0c1b2e7d4442
|