skills/cv/frame-prediction-averaging/SKILL.md
Average per-frame sigmoid predictions across sampled video frames to produce a stable video-level classification probability
npx skillsauth add wenmin-wu/ds-skills cv-frame-prediction-averagingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Video classification models often process individual frames independently. Averaging the sigmoid outputs across all sampled frames reduces noise from individual frame variability (occlusion, motion blur, detection failures) and produces a more stable video-level prediction. This is simpler and often competitive with temporal models like LSTMs for binary classification tasks.
import torch
import numpy as np
def predict_video(model, frames, device="cuda"):
model.eval()
batch = torch.stack(frames).to(device)
with torch.no_grad():
logits = model(batch).squeeze()
probs = torch.sigmoid(logits)
return probs.mean().item()
# frames: list of N preprocessed tensors from sampled video frames
video_prob = predict_video(model, face_tensors)
data-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF