Brand Safety & Ad Verification Pipeline
GARM-compliant brand safety pipeline for ad networks. Analyze video and image creatives for brand safety violations before serving.
import timefrom mixpeek import Mixpeekclient = Mixpeek(api_key="YOUR_API_KEY", namespace="brand-safety")# 1. A bucket for ad creatives, and a collection whose Gemini step scores each# scene against GARM categories as JSONbucket = client.buckets.create(bucket_name="ad-creatives",bucket_schema={"properties": {"creative": {"type": "video"}}},)collection = client.collections.create(collection_name="ad-creatives",source={"type": "bucket", "bucket_ids": [bucket["bucket_id"]]},feature_extractor={"feature_extractor_name": "multimodal_extractor","version": "v1","parameters": {"split_method": "scene","run_video_description": True,"description_prompt": "Assess this scene for brand safety.","response_shape": {"type": "object","properties": {"violence": {"type": "number"},"adult": {"type": "number"},"hate": {"type": "number"},"drugs": {"type": "number"},},},},},)# 2. Check one creative: upload it, process just that object, wait, read the scoresdef check_creative(creative_url):obj = client.buckets.upload(bucket["bucket_id"],blobs=[{"property": "creative", "type": "video", "data": creative_url}],)run = client.collections.trigger(collection["collection_id"], object_ids=[obj["object_id"]])while client.tasks.get(run["task_id"])["status"] not in ("COMPLETED", "COMPLETED_WITH_ERRORS", "FAILED"):time.sleep(10)scenes = client.documents.list(collection["collection_id"],filters={"AND": [{"field": "root_object_id", "operator": "eq", "value": obj["object_id"]}]},)scores = [doc.get("json_output") or {} for doc in scenes["results"]]worst = max((max(s.values(), default=0) for s in scores), default=0)return {"safe": worst < 0.15, "scene_scores": scores}print(check_creative("https://cdn.adnetwork.com/creative/12345.mp4"))
Feature Extractors
Multimodal Extractor
Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.
Retriever Stages
Use Cases Using This Recipe
Contextual Page Signals for Ad Placement
One article URL in, five structured signals out: IAB category, entities with salience scores, sentiment, brand safety, keywords.
Five, from a single pass
Signals per URL
Contextual advertising and ad-targeting teams who decide, per article, which creative renders beside it, and who need that decision to be defensible to a brand.
Related Recipes & Resources
Explore these related resources to deepen your understanding and discover more powerful features
Multimodal Extractor
Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.
Hierarchical Classification
Assign content to multi-level category hierarchies using embedding-based classification. Define your taxonomy once, then classify new content automatically with confidence scores.
Automated Video Tagging
Automatically generate descriptive tags for video content using scene analysis, object detection, and taxonomy classification. Each video receives structured labels for scenes, objects, actions, and custom business categories without manual annotation.
Video Scene Search
Find specific scenes within videos using natural language descriptions. The pipeline detects scene boundaries, generates embeddings for each scene, and enables precise timestamp-level search across an entire video library. Query for visual content, actions, or spoken dialogue.
Semantic Multimodal Search
Unified semantic search across all content types. Query by natural language and retrieve relevant video clips, images, audio segments, and documents based on meaning-not keywords or manual tags.
Feature Extraction
Multi-tier feature extraction that decomposes content into searchable components: embeddings, transcripts, detected objects, OCR text, scene boundaries, and more. The foundation for all downstream retrieval and analysis.