python-nsfw
A Python package for analyzing images using Caffe and Yahoo's open_nsfw models.
Prerequisites
python-nsfw requires Python 3 and runs on Caffe-compatible systems.
Caffe
If you're using macOS and Homebrew, the easiest way to install Caffe is with Homebrew:
brew install caffe
Alternatively, you could use a Docker Linux image (e.g. debian:stretch-slim) and install the necessary dependencies:
apt update && apt install caffe-cpu python3 python3-pip wget
Installation
python-nsfw may be installed using pip:
pip3 install nsfw
Usage
import PIL.Image as Image
from nsfw import classify
image = Image.open("/path/to/image.jpg")
sfw, nsfw = classify(image)
print("SFW Probability: {}".format(sfw))
print("NSFW Probability: {}".format(nsfw))
License
python-nsfw is freely available under the MIT License. Use it, learn from it, fork it, improve it, change it, tailor it to your needs.
python-nsfw ships with copies of Yahoo's open_nsfw Caffe models (nsfw/deploy.prototxt and nsfw/resent_50_1by2_nsfw.caffemodel) which are licensed under the BSD 2-Clause License.
Metadata
Release files for nsfw 0.3.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 | Provenance | Actions |
|---|---|---|---|---|
| nsfw-0.3.2.tar.gz | 22.1 MB | Without provenance | Details for nsfw-0.3.2.tar.gz |
Release files / nsfw-0.3.2.tar.gz
| Download URL | nsfw-0.3.2.tar.gz |
|---|---|
| Size | 22.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bc5dd5695a330f8f0425ec63e14cee44ad7ec962a654e00e743e95e7b812e6f
|
|
BLAKE2b-256 checksum How to use checksums |
8ed410d1d44d84d73ff032506ef3ec88f9bbd1350c06ddf8056d8e78096c2898
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for nsfw 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.