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
Metadata
Release files for nsfw-image-detector 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nsfw_image_detector-0.1.2.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nsfw_image_detector-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / nsfw_image_detector-0.1.2.tar.gz
| Download URL | nsfw_image_detector-0.1.2.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f8e453a0f7d70b3d065979a8f9649dae9e965e8661fbc3fe330e317cbe7809f
|
|
BLAKE2b-256 checksum How to use checksums |
5553913dc9b6c001e4e85b2c36c1468fd89a624f259b642a64a1d264b8fe7411
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|
Release files / nsfw_image_detector-0.1.2-py3-none-any.whl
| Download URL | nsfw_image_detector-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0802ff0891861c18d91489117c96c08b8732c42d513da814816407cc8f088c4
|
|
BLAKE2b-256 checksum How to use checksums |
e7885b8db6c7a5b8d9d237657e1aa55760db01279c5334630b0d0c1b2e7d4442
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|