skills/cv/weak-supervision-label-propagation/SKILL.md
Propagates image-level multi-labels to individual instances as weak supervision for instance-level training.
npx skillsauth add wenmin-wu/ds-skills cv-weak-supervision-label-propagationInstall 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.
When only image-level labels exist but instance-level predictions are needed, propagate image labels to every detected instance within that image. Each instance inherits all image-level labels, creating weak but usable supervision for training instance classifiers without expensive per-instance annotations.
import pandas as pd
def propagate_labels(image_labels_df, instances_df):
"""Assign image-level labels to each detected instance."""
rows = []
for _, img in image_labels_df.iterrows():
label_ids = str(img["Label"]).split("|")
instances = instances_df[instances_df["image_id"] == img["ID"]]
for _, inst in instances.iterrows():
for label in label_ids:
rows.append({
"image_id": img["ID"],
"instance_id": inst["instance_id"],
"label": int(label),
"bbox": inst["bbox"],
"mask": inst["mask_rle"],
})
return pd.DataFrame(rows)
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