Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nsfw_image_detector-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nsfw_image_detector-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file nsfw_image_detector-0.1.1.tar.gz.

File metadata

  • Download URL: nsfw_image_detector-0.1.1.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

Hashes for nsfw_image_detector-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d9bcc4b58ed00a62649bfa24d076c410ab736035d173fd7cd0430d18b48fe270
MD5 be48cb8adf53f7eced2943318af28689
BLAKE2b-256 07a7a75a675b63750cbf647401e065a810b641d8d93329665a1da34f22b4e1f6

See more details on using hashes here.

File details

Details for the file nsfw_image_detector-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nsfw_image_detector-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f6bbbdca5926ef10f8e70a41a7f405aa627d6d7e01aca6e5dcb8330ab5d3abf
MD5 df641159c8a1f3be4562591708a2c0d0
BLAKE2b-256 0b139f58604db037f9636fb07cd822b63082a53aae16817d3592344ceed1d0e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page