一键导入
cv-frame-prediction-averaging
Average per-frame sigmoid predictions across sampled video frames to produce a stable video-level classification probability
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Average per-frame sigmoid predictions across sampled video frames to produce a stable video-level classification probability
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Memory-efficient Keras generator that streams sharded CSV files in chunks, renders strokes to images on-the-fly, and yields batches for training on datasets too large for memory
Stack 1D convolutions for local feature extraction before bidirectional LSTMs to classify variable-length stroke sequences into hundreds of doodle categories
Partition a large dataset into N balanced shards using integer key modulo arithmetic for reproducible, class-interleaved splits across CSV files
Normalize raw stroke coordinates to 0-255 range, resample at uniform arc-length spacing, then apply Ramer-Douglas-Peucker simplification
Render stroke sequences to grayscale images with temporal intensity encoding where earlier strokes are brighter and later strokes fade to encode drawing order
Score each face in a video as anomalous by computing L2 distance from the embedding centroid of all faces, then convert to probability via logistic function
| name | cv-frame-prediction-averaging |
| description | Average per-frame sigmoid predictions across sampled video frames to produce a stable video-level classification probability |
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)