Nosmai Moderation
On-device moderation for images, video, text and the live camera. Tunable thresholds, no cloud round-trip.
Overview
Moderation runs entirely on the device — frames and messages never leave the phone. One license key unlocks four surfaces:
| Surface | What it does | Call |
|---|---|---|
| Image | Moderate a single photo | analyzeImage |
| Video | Sample + aggregate a recorded clip | analyzeVideo |
| Text | Moderate a chat message / comment | moderateText |
| Live camera | Real-time per-frame moderation | startStream + pushFrame |
What it detects
Visual — objects (NosmaiCategory): weapon, drug, cigarette, alcohol. Each frame returns the best confidence per class; a class is flagged when it meets its threshold.
Visual — NSFW (NosmaiNsfwVerdict): a whole-image verdict —
safe— clean.warn— suggestive / swimwear (advisory; does not flag the frame on its own).block— explicit (makes the frame unsafe).
Text (NosmaiTextCategory): profanity, toxic, hate, harassment, threat (plus safe). A two-layer pipeline — a keyword blocklist then an AI classifier.
Result shape
Every image / live result is a NosmaiResult:
| Field | Type | Description |
|---|---|---|
isUnsafe | bool | True if any object is flagged or NSFW is block |
detections | list | Flagged objects — { category, confidence } |
nsfw | enum | safe · warn · block |
nsfwScores | object | safe, sexy, explicit (0–1) |
rawScores | object | Best object score per class (debug / tuning) |
moderateText returns a NosmaiTextResult — { blocked, layer, category, score, matchedWord }.
analyzeVideo returns a NosmaiVideoResult — { isUnsafe, categories, flags[], framesAnalyzed, nsfw }.
Tunable thresholds
Every object class and NSFW bar is adjustable at runtime — lower is stricter. Defaults are tuned for a balance of recall and false positives.
setThreshold(weapon, 0.70) // object class bar
setNsfwThreshold(explicit, 0.45) // NSFW BLOCK bar
setNsfwThreshold(sexy, 0.55) // NSFW WARN bar
TIP
Because moderation runs on-device, there is no per-call cloud bill and content never leaves the user — solving latency and compliance at once.
Platform guides
Pick your platform for install + full usage (image, video, text, live):
On-device & licensing
The license key is verified online on first launch (so the first launch needs connectivity), then cached for 24h with a further 24h offline grace — after that the app runs offline within the grace window. All inference is hardware-accelerated on-device — see your platform guide for requirements.