Official Python SDK for the SafeVision visual content moderation API
Project description
SafeVision Python SDK
Official Python client for the SafeVision visual content moderation API.
Detect NSFW content, gore, weapons, and blood in images — then automatically blur or pixelate offending regions with a single API call.
Installation
pip install safevision
Quick Start
from safevision import SafeVision
sv = SafeVision(api_key="sv_live_your_key_here")
# Scan an image
result = sv.scan("photo.jpg")
print(result["safe"]) # True or False
print(result["categories"]) # detected classes + bounding boxes
print(result["latency_ms"]) # inference time in milliseconds
# Censor violations (blur / pixelate / black_box)
if not result["safe"]:
censored_bytes = sv.censor("photo.jpg", result, mode="blur")
with open("censored.jpg", "wb") as f:
f.write(censored_bytes)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key |
str | required | Your sv_live_… API key from the dashboard |
base_url |
str | https://safevision.guardextech.com |
API server URL |
Methods
scan(image_path) → dict
Scans an image and returns safety verdict + bounding box coordinates.
censor(image_path, moderation_results, mode) → bytes
Applies blur, pixelate, or black_box to detected regions. Returns censored image bytes.
Links
- 📖 Documentation
- 🔑 Get API Key
- 📧 Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file safevision-1.0.0.tar.gz.
File metadata
- Download URL: safevision-1.0.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34101a1d6b0b07a649c843dfbee13b0c67d86f0574185501d6fb890cc998e430
|
|
| MD5 |
dcd7401c1d0019abf4c01faa6960f042
|
|
| BLAKE2b-256 |
1ae70bd7f42f17614f35ad00ee2fab239f8d57d7eb6b5f6477a0efc8b66c2fb9
|
File details
Details for the file safevision-1.0.0-py3-none-any.whl.
File metadata
- Download URL: safevision-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8af1061b124f4dbfb047cc8d7aaf232e9f733a43c5ef17d536f559157364875
|
|
| MD5 |
afa9f4b62815645e40d65b99d28f402b
|
|
| BLAKE2b-256 |
6006e772e00f66b47057db1cf7770f3b365dfd4c77f355557eda820591ce4eaf
|