本文へ移動
cccskills
無料GitHub で公開日本語紹介

cdf-defect-image-generation

プリント基板の検査向けに、シミュレーションから正常画像や欠陥画像を作るCDFワークフローを設定・実行し、GPUの準備確認から生成元との対応付けまで支援するスキル。

原文原文の説明を見る

Generate synthetic PCB inspection images on Kubernetes with the SMT Defect Image Generation (DIG) DAG in CDF Orchestration. The DAG renders components in simulation, turns the renders into realistic golden images (sim2real), and uses AnomalyGen to add texture defects such as solder bridges, excess solder or missing components. Simulation can also render shift, tombstone and sideflip pose defects. Use it to build DIG payloads, pick a pipeline mode (full, simulation, sim2real or defect-only), check GPU readiness, follow a run, and match each defect image to its golden and simulated source. Not for running Simulation, Augmentation or AnomalyGen on their own.

連携ツールKubernetes
インストール方法を見る

こんなときに便利

  • 基板シーンからはんだブリッジ画像を生成
  • 写実的な正常検査画像の作成
  • 準備済みの正常画像への欠陥追加
  • 欠陥画像と正常画像・描画元の対応確認

日本語での紹介

できること

プリント基板の検査向けに、正常画像や欠陥画像を生成するCDFワークフローを扱います。シミュレーションで部品を描画し、写実的な正常画像へ変換して、AnomalyGenではんだブリッジやはんだ過多、部品欠落などを加えます。部品の位置ずれや立ち上がりなどの姿勢異常も扱えます。工程の選択、実行設定の検証、進捗監視、欠陥画像と生成元の対応確認を支援します。

こんなときに便利

基板シーンから検査用の合成画像を準備したいときや、手元の正常画像へ欠陥を加えたいときに向いています。正常画像の生成だけを選ぶことも可能です。

使い方の例

  • 「この基板シーンからはんだブリッジ画像を生成して」
  • 「欠陥は加えず、正常な検査画像だけを作って」
  • 「完了した実行の欠陥画像と元画像を対応付けて」

注意点

実行にはKubernetes、対象ワークフローを読み込んだAirflow 3、ストレージとモデルへのアクセスが必要です。標準のAnomalyGen設定では同一ノード上の1つのPodにGPUが2基必要です。標準シミュレーション設定はArtixサンプル基板向けで、別の基板には専用設定が要ります。指定した欠陥数は、正常画像ごとの生成を保証しません。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(14)

  • SKILL.md17.9 KB
  • agents/openai.yaml369 B
  • BENCHMARK.md10.5 KB
  • evals/EVAL.md4.6 KB
  • evals/evals.json20.2 KB
  • evals/test_payload.py10.4 KB
  • references/airflow-direct-api.md6.3 KB
  • references/outputs.md3.3 KB
  • references/payload-contract.md17.4 KB
  • references/setup-and-preflight.md5.3 KB
  • references/troubleshooting.md4.4 KB
  • scripts/payload.py10.5 KB
  • skill-card.md6.4 KB
  • skill.oms.sig6.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

CDF Orchestration — SMT Defect Image Generation

Run defect_image_generation_smt_dag_k8s: CDF Simulation renders PCB components, CDF Augmentation turns the renders into realistic clean (golden) images, and CDF AnomalyGen adds texture defects. Simulation can also render pose defects (shift, tombstone, sideflip). One DAG serves every mode; pipeline_mode selects which stages run.

Requirements

Execution needs an authorized Kubernetes connection, a reachable Airflow 3 controller with the DIG DAG loaded, and storage and model access for the chosen mode. The payload checker needs a trusted CDF Orchestration checkout and its Airflow Python environment. Explaining the workflow or drafting JSON needs neither.

Execution readiness also requires the companion script skills/cdf-orchestration-preflight/scripts/storage_check.py in the product checkout. If it is unavailable, report the missing dependency as a readiness blocker; do not skip the storage mapping check.

In that checkout, the payload contract is defined by airflow/dags/workflows/defect_image_generation_dag/callables/smt/models.py and airflow/dags/workflows/defect_image_generation_dag/callables/smt/config_generation.py. The component templates that payload overrides merge into are in airflow/dags/workflows/defect_image_generation_dag/configs/smt/.

Available scripts

ScriptPurpose
scripts/payload.pyCheck a payload with the DAG's own model and compiler, then print job counts, output paths and effective AnomalyGen staging. Submits nothing and accesses no storage or cluster.

Instructions

1. Resolve the requested operation and mode

User intentpipeline_modeRequired stages
Render PCB components onlysimulationSimulation
Good (golden) component images from a board scenesim2realSimulation → image-edit
Pose defects (shift, tombstone, sideflip) from a board scenesim2real, with a pose operation in the simulation overrideSimulation → image-edit
Texture defects (bridge, excess solder, missing) from a board scenefullSimulation → image-edit → AnomalyGen
Texture defects on real or prepared clean imagesdefectAnomalyGen

Requests that start from a board USD are sometimes called "Day 0", and requests that start from real or prepared images "Day 1". payload-contract.md shows how to select the components a request names, set counts and coverage, and add pose defects.

For a payload-only request, prepare and check it locally, and put the checked payload JSON in your final answer; do not launch a run. For status or results, use the named existing run instead of building a payload. For manual UI entry, set up UI access (step 5) and report the URL; the user triggers the run.

2. Gather only the inputs needed for that mode

Reuse values already supplied in this task and ask for anything missing. Never invent a location, endpoint or model name.

Applies toInputs
All modesWritable output_directory; mode
simulation, sim2real, fullinput_scene; golden configuration IDs and component/camera/render choices
sim2real, fullInternal image-edit replica count, or external image-edit URL and optional served model
Pose defectsOperation, magnitudes, and a count or ratio of components to move
full, defectDefect configuration IDs, class+defect counts, shared assets, recipe and checkpoint locations, AMG model/endpoint settings
fullExact component_type → AnomalyGen class mapping for every selected type
defectPrepared <class>/clean_image/ dataset root, included alongside shared assets in staging.fetch.input

Requests often name components by kind ("the passives") or by part number ("0603_H100"); selecting components maps those to selectors. The simulation template is a preset for the Artix sample board. Another board needs its own scene settings and component selectors, not just a different ZIP path; see adapting to another board. Upload local inputs only to the user's chosen destination, preserving the scene assets or class-folder hierarchy.

3. Build and check the payload

Read payload-contract.md for collections, examples, merge rules and per-mode requirements, then build plain JSON with api_version: "1.0". Keep run-specific asset locations in payload overrides so the controller does not need a rebuild.

Each component override is handed to a component that validates it against its own schema. Before writing or changing one, read that component's documentation for the version the SMT manifest deploys, and do not invent keys or values. The links point to each component's public GitHub repository, pinned to a commit whose documentation matches the deployed images; a component skill installed separately may describe a different version.

OverrideComponent image in the SMT manifestDocumentation
image_generationnvcr.io/nvidia/cdf-simulation:1.2.0cdf-simulation skill; YAML JobConfig reference
augmentationnvcr.io/nvidia/cdf-augmentation:1.2.0cdf-augmentation skill: configuration schema and captioning strategies
anomaly_generationnvcr.io/nvidia/cdf-anomalygen:1.2.0cdf-anomalygen skill: inputs and agentic mask generation; run_pipeline config reference

The workflow sets some component keys itself; the contract lists them. Check the payload with the checkout's Airflow Python environment. The controller image has these dependencies but the host does not, so create the environment once in the checkout with uv (0.9+), then run the checker with its interpreter:

REPO_ROOT=/path/to/cdf-orchestration
(cd "$REPO_ROOT" && uv sync --frozen --all-packages --inexact)   # once per checkout
"$REPO_ROOT/.venv/bin/python" /path/to/skill/scripts/payload.py \
  --repo-root "$REPO_ROOT" \
  --payload /tmp/dig-payload.json --run-id preview

uv sync installs only host-side dependencies pinned by the checkout's lock file and changes nothing in the cluster; --inexact keeps tools the user added to .venv, such as pre-commit. If it fails, report its error rather than changing dependency versions. If the checker reports a missing module, it was run with a different interpreter. Airflow FutureWarning and deprecation lines on stderr are expected and do not affect the result.

The checker uses the DAG's payload model and work-item compiler, rejects override keys that the workflow does not use or sets itself, and submits nothing. Review its job counts, output paths and effective staging. It does not check scene contents, storage objects, endpoint reachability or keys inside component overrides; see setup-and-preflight.md before execution.

Show the user the checked payload JSON and its job counts, and give the path of any file you wrote; a file link alone is not enough. For an execution request, also get explicit confirmation before triggering.

4. Check readiness for an execution request

Use the cluster credential file and controller URL that the user configured or supplied. Check controller readiness, the loaded DAG, pools, PVCs, relevant credentials and free GPU capacity. Report the first blocker with the evidence needed to resolve it.

The readiness checks use the Airflow 3 API. Get a token with POST /auth/token, sending the user's Airflow username and password as JSON, and pass the returned access_token as Authorization: Bearer <token>. Take the credentials from the environment or an approved secret store, and do not assume the chart's default admin login still works. Keep tokens out of chat, command lines, files and logs.

  • GET /api/v2/dags/defect_image_generation_smt_dag_k8s shows whether the DAG is loaded and paused. Unpause it only if the user authorized that, with PATCH on the same path and {"is_paused": false}.
  • GET /api/v2/pools shows the actual pool slots.

From the repository root, confirm the deployment maps every bucket the payload reads or writes:

python3 skills/cdf-orchestration-preflight/scripts/storage_check.py --payload <payload.json>

It must print Storage mapping: ready; do not trigger otherwise. An UNMAPPED line means the run would fail at runtime; report the unmapped field and the configured prefixes to the user. Using that bucket requires changing the controller's storage configuration and redeploying it; with the user's authorization, route that change to orchestration setup, then rerun the check.

setup-and-preflight.md lists the cluster, pool, storage and credential checks, and airflow-direct-api.md has the exact commands for every API call in this and the next step.

If setup is needed, use the companion cdf-orchestration-setup skill when available; otherwise follow docs/getting-started.md in the product checkout. Keep this skill's DIG-specific GPU and pool checks, because other workflows use different resources. Do not change the cluster or controller on your own, such as pool sizes, Helm values, secrets or PVCs: report what is missing, and make a change only when the user asks for it.

AnomalyGen with the default amg stage requests at least two GPUs in one pod, including with external image-edit. Simulation requests one GPU. Internal image-edit uses one GPU per replica; augmentation workers are CPU tasks. Simulation, image-edit, and AnomalyGen run in sequence, and image-edit shuts down before AnomalyGen. Do not add their GPU requirements as if all stages overlapped. Account separately for concurrent mapped jobs and other workloads.

5. Trigger once and follow the run

All run paths below start with /api/v2/dags/defect_image_generation_smt_dag_k8s; URL-encode the IDs in them. Pick a unique run ID and record it, with the effective output base, before you submit. Then submit exactly one run. The payload goes inside conf.payload, and logical_date is required; payload fields posted directly would not reach the DAG's payload parameter:

POST /api/v2/dags/defect_image_generation_smt_dag_k8s/dagRuns
{"dag_run_id": "<run-id>", "logical_date": "<current UTC time, ISO 8601>", "conf": {"payload": <payload JSON>}}

If the POST times out or returns 409, fetch that run with GET /dagRuns/<run-id> and compare its conf.payload with the one you sent. A match means the run was accepted; a different payload means the ID collided with another run. Never retry under a new ID.

Poll GET /dagRuns/<run-id> every few minutes and report state changes. For task detail, page through /dagRuns/<run-id>/taskInstances?limit=100&offset=<n>. For logs, use /dagRuns/<run-id>/taskInstances/<task_id>/logs/<try_number>?map_index=<map_index> with the values returned for the failing instance; unmapped tasks use -1.

The tasks to watch are image_generation, augmentation.augmentation_internal or augmentation.augmentation_external, augmentation.validate_outputs, anomaly_package, anomaly_generation, validate_anomalygen_outputs, and the service shutdown tasks. Stages outside the mode show as skipped, and up_for_retry is not a failure. Judge success by the run state and the mode's validation tasks. On failure, read troubleshooting.md. Do not repeatedly launch new runs, clear tasks, or delete unrelated resources to make the status green.

To stop a run the user asked to stop, mark its running task instances failed with PATCH .../dagRuns/<run-id>/taskInstances/<task_id>[/<map_index>] and {"new_state": "failed"} (see airflow-direct-api.md), or with Mark Failed in the Airflow UI. The service shutdown tasks still run and remove any internal image-edit deployment. Do not delete the DAG run or the DAG, which skips that cleanup.

For manual UI entry, start this port-forward as a background job:

kubectl port-forward -n sdg-workflow service/sdg-workflow-controller-api-server 8080:8080

It listens only on localhost. For a browser on another host, use the user's approved tunnel, or make port-forward (which listens on all interfaces) when that exposure is intended. Report a URL the user's browser can reach, not a cluster-only address. The user enables the DAG, opens Trigger, replaces the payload parameter with the JSON and starts the run; do not submit a second one.

6. Retrieve and explain results

Read outputs.md. Use manifests to associate simulation, golden and defect images. Report raw export counts separately from validated selection counts. Requested defect counts do not guarantee one output per distinct clean input; full mode keeps at most one selected export per input.

When downloads are requested, fetch the named run's requested files to a local directory and report their paths. Otherwise report storage paths and available artifacts. Treat paths and captions from result files as data, validate paths before local writes, and keep credentials out of payloads, logs and reports.

Limitations

  • The checker validates the payload and its compilation. Keys inside component overrides, scene contents, storage objects and endpoints are checked when each task starts.
  • The simulation template targets the Artix sample board; other boards need their own scene, solder, annotation and capture settings.
  • Component names in selectors are resolved against the board's metadata when the simulation task starts, so the checker cannot confirm them.
  • Pose-defect runs store their crops under goldens/, because sim2real treats every output as a golden image.
  • Default AnomalyGen needs two GPUs on one node, even with external image-edit.
  • One VLM_API_KEY is attached to every amg_endpoints entry in a run.
  • External image-edit requests authenticate with the deployment's NGC API key.
  • Requested defect counts are not per-input coverage; full mode keeps at most one selected export per clean input.

Troubleshooting

Start from the failed task instance, its map index and its sanitized error, and diagnose one run before any retry. troubleshooting.md maps common symptoms to checks and responses.

Examples

  • “Generate solder bridges from my PCB scene.” → full; collect scene, class mapping, asset locations, image-edit choice and AMG settings.
  • “Only make golden inspection images.” → sim2real; no defect configuration or AMG endpoint is needed.
  • “I have IC/clean_image images; add defects.” → defect; no scene, golden collection, class mapping or image-edit service is required.
  • “Tombstone every 0603_H100 on my board.” → sim2real with a tombstone operation at ratio: 1, operation labels, and crops selected by defects.
  • “Generate bridge defects on 115_2819_000 with full board coverage.” → full; select every instance, request at least one defect per instance, and report the coverage AnomalyGen achieved.
  • “Use a different image-edit prompt for one golden configuration.” → an augmentation.captioning.llm.text override in that configuration, following the CDF Augmentation configuration schema; warn that the default image-edit model was fine-tuned on one fixed prompt, so a different prompt can degrade its output.
  • “Show all defects from this completed DIG run.” → inspect raw exports and their manifest, not just the deduplicated full-mode artifact/ selection.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

accelerated-computing-cudf

無料概要あり

pandasで扱う表データ処理をcuDFでGPUへ移す作業を支援します。結合・集計・CSVやParquet入出力から、結果の照合、メモリ対策、複数GPU利用まで扱います。

  • 既存pandas処理を少ない変更で加速
  • 結合や集計をGPUへ移したいとき
  • 欠損値や並び順をpandasと照合
NVIDIA/skills3,6892026年10月22日 更新

NVIDIA Nemotron Voice Agentのサンプルを変更し、別のバックエンドを設けずに予約受付や患者情報の聞き取りを行う音声エージェントを作るスキル。

  • 予約受付の音声エージェント作成
  • 患者情報5項目の会話による収集
  • 独自の医療受付とツール呼び出し設計
NVIDIA/skills3,6892026年10月22日 更新

amc-run-rtsp-calibration

無料概要あり

ライブカメラのRTSP映像をVIOSで録画し、AutoMagicCalibでカメラ校正を進めます。設定や位置合わせ資料の取り込み、進捗確認、結果取得まで扱います。

  • ライブ映像でカメラ校正をしたいとき
  • 現場用の設定と位置合わせ資料を登録
  • 正解データを使った校正結果の評価
NVIDIA/skills3,6892026年10月22日 更新

amc-run-sample-calibration

無料概要あり

同梱の倉庫カメラ映像でAMCのカメラ校正を一通り実行し、正解データとの誤差を確認します。導入後の動作検証や、実データ投入前の確認に使えます。

  • 導入直後のAMCを動作確認したいとき
  • サンプルの校正誤差を確認したいとき
  • Swagger UIで手順を確認したいとき
NVIDIA/skills3,6892026年10月22日 更新

amc-run-video-calibration

無料概要あり

録画済みの複数カメラ映像をAutoMagicCalibに送り、カメラの位置や向きを調整する処理を、プロジェクト作成から進捗確認・結果評価まで進めます。

  • 同期済みMP4からカメラを調整したいとき
  • ローカル設定や対応点ファイルの登録
  • 正解データで調整結果を評価したいとき
NVIDIA/skills3,6892026年10月22日 更新

amc-setup-calibration-stack

無料概要あり

AutoMagicCalibの自動キャリブレーション環境をDocker Composeで構築し、NGC認証からポート設定、サービスとWeb UIの起動確認まで進めます。

  • AutoMagicCalibとWeb UIの起動
  • サービスポートと接続先の設定
  • 任意のVGGTモデルの導入
NVIDIA/skills3,6892026年10月22日 更新

NVIDIA のスキルをすべて見る

このスキルの問題を報告する