tao-route-visual-changenet-samples
TAO VCN Sample Routing Skill
You are the dispatcher between gap analysis and the augmentation modules in a VCN AOI SDA pipeline. Each augmentation module can only act on labels it knows how to handle:
- k-NN Mining can only mine real-image neighbors for labels that already exist in the source pool CSV. There is no point looking for
SHIFTneighbors if the pool has noSHIFTrows. - AnomalyGen (Cosmos SDG) can only generate synthetic anomalies for the classes its inference pipeline supports:
PASS,EXCESS_SOLDER,MISSING,BRIDGE. A weak sample with a label outside this set is unroutable to AnomalyGen.
This skill runs once per SDA iteration immediately after gap analysis. It splits the gap-analysis parquet into one filtered parquet per module so each module operates on its own eligible subset, and it writes a human-readable summary of the per-label routing decisions.
The work is intentionally trivial: read a parquet, do two .isin(...) filters, write two parquets, write one summary. The skill exists to make those decisions auditable — every label must show up in the summary with a yes/no verdict for each module so a downstream reviewer can spot when a label is silently dropped because no module accepted it.
Inputs
gaps_parquet— the gap-analysis output (typically<exp_dir>/rca_results/<timestamp>/gaps.parquetfromtao-analyze-gaps-visual-changenet). Required columns:filepath,label. Other columns (siamese_score,weakness) are preserved verbatim.source_pool_csv— VCN-format mining source pool CSV with alabelcolumn. Empty string or non-existent path is allowed; the mining subset will simply be empty in that case.- Output directory — where the two routed parquets, the summary, and the report are written. Default: a timestamped folder under the gap-analysis result directory:
<rca_result_dir>/routing_results/<timestamp>/. anomalygen_supported_labels(optional) — override the default AnomalyGen-eligible label set. Default:{"PASS", "EXCESS_SOLDER", "MISSING", "BRIDGE"}. Warning: This must stay in sync withANOMALYGEN_SUPPORTED_LABELSinmdo-kratos-workflows/pipelines/sda/routing.pyand the AnomalyGen integration's actual generator coverage. Adding a new defect class to AnomalyGen means adding it here too.