Skip to main content
PickTensorSoftware & AI Studio
Back to All WorkAI / ML Engineering
CompletedAI & Computer VisionComputer Vision

VidClean — Multimodal Video & Scene Analysis Pipeline

Multi-stage computer vision and audio-context pipeline combining ViT, ONNX, SigLIP2, Whisper, and local VLMs.

Role: AI & Systems Engineer
Team: 1 Engineer
Areas:Computer VisionImage and Video ProcessingLLM Applications
4 Models
Visual Stages
Marqo + NudeNet + AdamCodd + SigLIP2
3 FPS
Default Scan Rate
Configurable keyframe & dark stride
100% Local
Execution Mode
CUDA FP16 or CPU + local Ollama

Overview

A precision local-first video scanning engine that detects explicit frames, scene boundaries, and narrative context by chaining fast gatekeeper vision models, ONNX anatomical detection, zero-shot SigLIP2 classification, and Whisper + Ollama verification.

Models, Dataset & Methodology

Models Used

Marqo/nsfw-image-detection-384 (timm ViT)NudeNet (ONNX)AdamCodd/vit-base-nsfw-detectorgoogle/siglip2-base-patch16-224faster-whisperQwen / Qwen-VL (Ollama)

Methodology & Pipeline

Extracts frames via FFmpeg at configurable FPS (default 3 FPS), applies dark-scene luminance enhancement when mean frame luma falls below 42.0, deduplicates static frames using thumbnail Mean Absolute Difference (MAD) thresholds, and clusters timestamped hits into deduplicated scene intervals.

Inference & System Architecture

Stage 1 (Marqo ViT 384) acts as a batched gatekeeper with MAD static-frame inheritance. Flagged or keyframe candidates pass to Stage 2 (NudeNet ONNX batch detector for anatomical + face-proximity bounding boxes) and conditional Stage 3 (AdamCodd ViT-384 verifier). Keyframes with couple proximity or elevated gate scores buffer into Stage 4 (SigLIP2 zero-shot cosine-similarity prompts). Meanwhile, a background ThreadPoolExecutor runs faster-whisper translation and local Qwen story/VLM cross-checks.

Problem & Context

Single-model frame classifiers either burn excessive GPU/CPU compute running heavy transformers on every frame or trigger false positives on dark scenes, close-ups, and story-critical dramatic dialogue.

Modeling & Pipeline Approach

Designed a cascading four-stage visual pipeline paired with concurrent audio transcription and vision-language cross-verification so heavy models execute only on informative keyframes and ambiguous windows.

Pipeline Implementation

Implemented reusable tensor preprocessing pipelines for timm and HuggingFace models, automatic FP16 autocast when CUDA is detected, and tiered interval merging (explicit > kissing > buildup) with face-mask tracking for retained narrative scenes.

Evaluation & Telemetry

Structured JSON telemetry logs per-frame Marqo/AdamCodd probabilities, explicit bounding classes, story relevance flags, scene dialogue transcripts, and total scan elapsed time while skipping redundant static frames up to configured streak limits.

Core Capabilities

  • 4-stage cascading visual inference with adaptive static-frame deduplication
  • Automatic dark-scene luma enhancement for low-light video frames
  • Concurrent audio extraction and faster-whisper transcription during visual scanning
  • Vision-language cross-verification for borderline frames and transcript-flagged windows
  • Tiered interval clustering avoiding duplicate overlapping scene ranges

Engineering Challenges & Edge Cases

  • Balancing inference throughput on long videos without dropping rapid cuts or dark scenes
  • Reducing false positives on romantic/narrative scenes by fusing visual hits with transcript context
  • Managing memory and batch latency across multiple vision models and audio threads

Evaluation & Outcomes

  • Built a modular core package separating media I/O, tensor preprocessing, scoring, and scene reporting
  • Delivered a CLI runner supporting configurable FPS, batch size, Whisper model size, and an optional fast visual-only mode

Technical Stack

Languages

Python

Models

Marqo/nsfw-image-detection-384 (timm ViT)NudeNet (ONNX)AdamCodd/vit-base-nsfw-detectorgoogle/siglip2-base-patch16-224faster-whisperQwen / Qwen-VL (Ollama)

Libraries

PyTorchtimmTransformersOpenCVNumPyPillow

Infrastructure

ONNX RuntimeFP16 CUDA / CPU InferenceFFmpegOllama

Technologies

PythonPyTorchONNXTransformersOpenCVWhisperNumPy
Tags:#Computer Vision#PyTorch#ONNX#SigLIP2#Whisper#Multimodal AI

Need similar engineering architecture for your product?

Discuss your goals directly with Danish Saifi at PickTensor.

Start a Discussion