skills/cv/stroke-temporal-color-rendering/SKILL.md
Render stroke sequences to grayscale images with temporal intensity encoding where earlier strokes are brighter and later strokes fade to encode drawing order
npx skillsauth add wenmin-wu/ds-skills cv-stroke-temporal-color-renderingInstall 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.
Hand-drawn sketches are stored as ordered stroke sequences. When rendering to an image, encoding the drawing order as pixel intensity — earlier strokes brighter, later strokes darker — gives CNNs an additional temporal signal beyond pure geometry. This simple trick improves doodle classification accuracy by 1-3% over flat-color rendering.
import cv2
import numpy as np
import json
def draw_strokes(raw_strokes, size=64, line_width=6):
img = np.zeros((256, 256), np.uint8)
for t, stroke in enumerate(raw_strokes):
color = max(255 - t * 13, 30) # fade from 255 to ~30
for i in range(len(stroke[0]) - 1):
cv2.line(img,
(stroke[0][i], stroke[1][i]),
(stroke[0][i + 1], stroke[1][i + 1]),
color, line_width)
if size != 256:
img = cv2.resize(img, (size, size))
return img
strokes = json.loads(drawing_string)
img = draw_strokes(strokes, size=64)
[[x0, x1, ...], [y0, y1, ...]] per stroke255 - t * step, clamped to a minimum13 per stroke works for ~20-stroke drawings; adjust for longer sequencesdata-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