Skip to main content

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

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

safevision-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

safevision-1.0.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

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

Hashes for safevision-1.0.0.tar.gz
Algorithm Hash digest
SHA256 34101a1d6b0b07a649c843dfbee13b0c67d86f0574185501d6fb890cc998e430
MD5 dcd7401c1d0019abf4c01faa6960f042
BLAKE2b-256 1ae70bd7f42f17614f35ad00ee2fab239f8d57d7eb6b5f6477a0efc8b66c2fb9

See more details on using hashes here.

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

Hashes for safevision-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8af1061b124f4dbfb047cc8d7aaf232e9f733a43c5ef17d536f559157364875
MD5 afa9f4b62815645e40d65b99d28f402b
BLAKE2b-256 6006e772e00f66b47057db1cf7770f3b365dfd4c77f355557eda820591ce4eaf

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