Building Background Effects for Clips
Slack's Clips background blur and image replacement run as a browser and desktop pipeline. Webcam frames are read via the Insertable Streams API on a worker thread, downscaled to 256x144, and segmented by MediaPipe's landscape selfie model compiled to WebAssembly. All compositing happens in WebGL shaders. The mask is upsampled and bilateral-filtered to smooth edges. Blur uses a mask-weighted Gaussian that also weights each sample by the mask to prevent haloing. Replacement blurs the mask most where confidence is near 0.5, thresholds it into a crisp edge, blurs the background, then alpha-blends. Edge-detection fusion was prototyped but was too unreliable on noisy or low-contrast regions to ship.
Related posts
- Build awesome datasets for video generation
Hugging Face mediumAdeptA three-stage pipeline for building small video-generation fine-tuning datasets: acquisition with yt-dlp and scene splitting, per-frame filtering for watermarks, aesthetics and NSFW content plus an OpenCV motion score, and captioning with Florence-2 or a video captioner like Qwen2VL. Filtering the crush-smol dataset on pwatermark < 0.1 and aesthetic > 5.5 kept only 47 of 1493 clips. The authors conclude that averaging watermark scores across frames with a 0.2–0.3 threshold works better, and that aesthetic scores are biased toward colorful, regular shapes and suit a minimum cutoff of about 4.25–4.5. The resulting datasets were used to fine-tune CogVideoX-5B with finetrainers for effects like Crush and Cakeify.
- Building an AI WebTV
Hugging Face mediumAdeptThe AI WebTV is an experimental 24/7 stream of short clips generated by open-source text-to-video and music models. ChatGPT expands a human-written theme into per-shot prompts. Zeroscope V2 then generates 576x320 clips, and Zeroscope XL upscales them to 1024x576 using the same prompt. FILM frame interpolation smooths the clips and MusicGen adds a soundtrack. A Node/TypeScript orchestrator calls these models on Gradio Spaces via @gradio/client, and FFmpeg concatenates an ffconcat playlist into a low-latency FLV stream sent to an RTMP server (node-media-server). Prompting lessons include specifying camera and subject motion and direction, and repeating full details in every prompt for cross-scene consistency. Frame interpolation can hide rendering artifacts, while known failure modes include reversed motion and prompt words like "IMAX" appearing as text in frames.
- Video Invisible Watermarking at Scale
Meta Engineering mediumAdeptMeta runs ML-based invisible video watermarking (VideoSeal-style) as a custom FFmpeg filter for provenance use cases like detecting AI-generated video and identifying first uploaders. GPU deployment suffered from CPU-GPU frame transfer overhead, missing hardware video encoders, contention across parallel requests and model loading costs, so the team moved to CPU-only inference; with tuned encoder, decoder and PyTorch threading plus sampling parameters, single-process latency came within 5% of GPU and scaled across parallel FFmpeg processes more efficiently. A frame-selection method cut an initial ~20% BD-Rate regression, and crowdsourced manual review was needed because VMAF and SSIM missed watermark artifacts.
- Multi‑Ratio Video Resizing for Mobile Feed and Marketing
Netflix TechBlog easyNoviceNetflix automatically reframes 16:9 footage into 9:16, 4:5 and 1:1 crops with a "virtual camera" pipeline built in three stages. A neural shot-boundary detector segments the video, and Active Speaker Detection (face detection plus LipFlap) splits conversation shots into sub-shots. Faces are then ranked with saliency, speaker status and size to find a focus region, and temporal reframing locks a static crop for small motion or computes a smoothed panning path for large motion. The algorithm is built into Netflix's internal Clips tool with manual adjustment controls and XML export to Adobe Premiere, and in Netflix's internal test it outperformed Premiere's Auto Reframe on a curated evaluation set.
- Zero-shot image-to-text generation with BLIP-2
Hugging Face mediumAdeptBLIP-2 connects a frozen pre-trained image encoder (ViT) to a frozen LLM (OPT or Flan-T5) through a lightweight Querying Transformer (Q-Former), the only trainable component. This cuts trainable parameters and pre-training cost while reaching state-of-the-art results on visual-language tasks. Q-Former is pre-trained in two stages. The first uses image-text contrastive, image-grounded generation and image-text matching losses. The second feeds its query outputs to the LLM as a visual prefix under a causal LM loss. Code examples with Hugging Face Transformers show zero-shot image captioning, prompted captioning, visual question answering with a "Question: Answer:" template, and chat-style prompting, which must stay within the 512-token context.