freepik-company/nsfw_image_detector

Support for the model NSFW in hugging face

Python

2

7 commits

updated May 5, 2025

See the code

README

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

freepik-company/nsfw_image_detector

Support for the model NSFW in hugging face

Python

2

7 commits

updated May 5, 2025

See the code

README

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 health

Latest release

0.1.2 · May 5, 2025

Releases this year

0