Socket
Book a DemoInstallSign in
Socket

nsfw-image-detector

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nsfw-image-detector

A powerful NSFW content detection library using EVA-based vision transformer

pipPyPI
Version
0.1.2
Maintainers
1

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

Keywords

nsfw

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts