skills/cv/temporal-frame-jitter-augmentation/SKILL.md
Add random temporal offset to the center frame during training to augment temporal diversity in video-based models
npx skillsauth add wenmin-wu/ds-skills cv-temporal-frame-jitter-augmentationInstall 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-based models that extract a fixed temporal window around a labeled frame can overfit to the exact frame alignment. Adding a small random integer offset to the center frame index during training shifts the entire crop window, exposing the model to slightly different temporal contexts of the same event. This is the temporal equivalent of spatial translation augmentation.
import random
class VideoDataset:
def __init__(self, frames, labels, window=24, jitter=6, mode='train'):
self.frames = frames
self.labels = labels
self.window = window
self.jitter = jitter
self.mode = mode
def __getitem__(self, idx):
frame = self.frames[idx]
if self.mode == 'train':
frame = frame + random.randint(-self.jitter, self.jitter)
start = frame - self.window
end = frame + self.window + 1
clip = self.load_frames(start, end)
return clip, self.labels[idx]
random.randint(-jitter, jitter) to the center framedata-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