tao-analyze-gaps-vlm-bcq
NVIDIA/skills
モデルの応答をグラウンドトゥルースと比較することで、VLMによる二値分類問題の予測から偽陽性および偽陰性のギャップを抽出し、下流の根本原因分析のために構造化されたJSONLファイルと要約レポートを生成する。
...すべて拡張しますVLM 二値分類のギャップ分析
VLMの予測JSONを読み込み、各モデルの応答を真値と比較し、FP/FNの失敗事例を要約レポートと共にJSONLファイルに書き出します。
目的
「はい/いいえ」の二値評価タスクでVLMを実行した後、予測結果をグラウンドトゥルースと比較し、失敗ケースを特定する必要があります。 このスキルは、FP(偽陽性)およびFN(偽陰性)サンプルの構造化されたリストを生成し、下流のRCCA段階(例:コスモス生成、根本原因分析)がこれを活用してDEFTの反復処理を推進します。
使用方法
TAO Toolkitのデータサービスコンテナ内で、Hydra形式のkey=valueオーバーライドを使用してvlm_bcqアクションを呼び出します:
gap_analysis vlm_bcq \
predictions_json=/path/to/results.json \
results_dir=/path/to/output/gaps
予測結果内のvideo_idの値が相対パスである場合は、videos_dir を指定してください:
gap_analysis vlm_bcq \
predictions_json=/path/to/results.json \
results_dir=/path/to/output/gaps \
videos_dir=/path/to/videos/root
実行後、kpi_gaps_report.txtから FP/FN のカウントを抽出し、下流のステージでkpi_gaps.jsonl を指定します。
入力
- predictions_json: 予測 JSON ファイルへのパス。各項目に
video_id、response、gtフィールドを含む JSON 配列でなければなりません。responseとgt は単語境界マッチングで解析されます。文字列内のどこかに'yes'または'no'が含まれていれば認識されます。両方が含まれているサンプルや、どちらも含まれていないサンプルは、警告とともにスキップされます。 - videos_dir(オプション):相対的な
video_idパスを解決するためのベースディレクトリ。省略された場合、video_idの値は絶対パスとして扱われます。
予測結果のJSON形式:
[
{
"video_id": "/path/to/video.mp4",
"response": "Yes, there is a collision.",
"gt": "B. いいえ",
"question": "競合はありますか?"
}
]
出力
- kpi_gaps.jsonl: FP/FNの各ケースについて、1行につき1つのJSONオブジェクト。フィールド:
video_id(絶対パス)、error_type(FPまたはFN)、question、ground_truth、response。 - kpi_gaps_report.txt: FP/FNの合計件数を記載した、人間が読みやすい形式の表。
ギャップが見つからない場合、ファイルは書き込まれず、メッセージがログに記録されます。
主要なパラメータ
| パラメータ | 必須 | 説明 |
|---|---|---|
| predictions_json | はい | 予測 JSON ファイルへのパス |
| results_dir | はい | 出力ディレクトリ。存在しない場合は作成される |
| videos_dir | いいえ | 相対的なvideo_idパスを解決するためのベースディレクトリ |
エラーパターン
| エラー | 原因 | 修正方法 |
|---|---|---|
FileNotFoundError |
predictions_jsonが存在しない |
パスを確認してください |
ValueError: JSON配列でなければなりません |
予測ファイルがリストではありません | 予測を[...]で囲んでください |
ValueError: 'gt'/'response'/'video_id' が欠落しています |
予測項目に必須フィールドが欠けています | 予測の JSON を確認して修正してください |
| サンプルが黙ってスキップされました | responseまたはgtに 'yes' と 'no' が両方含まれているか、どちらも含まれていない |
ログに警告がないか確認し、該当するサンプルを調査してください |
---
name: tao-analyze-gaps-vlm-bcq
description: Extract false-positive and false-negative gaps from VLM binary-classification-question predictions by comparing model responses against ground truth, producing a structured JSONL file and summary report for downstream root-cause analysis.
license: Apache-2.0
---
# VLM Binary Classification Gap Analysis
Reads a VLM predictions JSON, compares each model response against ground truth, and writes FP/FN failure cases to a JSONL file with a summary report.
## Purpose
After running a VLM on a binary yes/no evaluation task, the predictions need to be compared against ground truth to identify failure cases. This skill produces a structured list of FP (false positive) and FN (false negative) samples that downstream RCCA stages (e.g., cosmos generation, root cause analysis) consume to drive a DEFT iteration.
## Usage
Invoke the `vlm_bcq` action inside the TAO Toolkit data services container with Hydra-style key=value overrides:
```bash
gap_analysis vlm_bcq \
predictions_json=/path/to/results.json \
results_dir=/path/to/output/gaps
```
Include `videos_dir` when `video_id` values in the predictions are relative paths:
```bash
gap_analysis vlm_bcq \
predictions_json=/path/to/results.json \
results_dir=/path/to/output/gaps \
videos_dir=/path/to/videos/root
```
After the run, surface the FP/FN counts from `kpi_gaps_report.txt` and point downstream stages at `kpi_gaps.jsonl`.
## Inputs
- **predictions_json**: Path to predictions JSON file. Must be a JSON array where each item has `video_id`, `response`, and `gt` fields. `response` and `gt` are parsed with word-boundary matching — `'yes'` or `'no'` anywhere in the string is recognized. Samples where both or neither are present are skipped with a warning.
- **videos_dir** (optional): Base directory for resolving relative `video_id` paths. If omitted, `video_id` values are used as absolute paths.
**Predictions JSON format:**
```json
[
{
"video_id": "/path/to/video.mp4",
"response": "Yes, there is a collision.",
"gt": "B. No",
"question": "Is there a collision?"
}
]
```
## Outputs
- **kpi_gaps.jsonl**: One JSON object per line for each FP/FN case. Fields: `video_id` (absolute path), `error_type` (`FP` or `FN`), `question`, `ground_truth`, `response`.
- **kpi_gaps_report.txt**: Human-readable table with total FP/FN counts.
If no gaps are found, no files are written and a message is logged.
## Key Parameters
| Parameter | Required | Description |
|-----------|----------|-------------|
| predictions_json | Yes | Path to predictions JSON file |
| results_dir | Yes | Output directory; created if it does not exist |
| videos_dir | No | Base directory for resolving relative `video_id` paths |
## Error Patterns
| Error | Cause | Fix |
|-------|-------|-----|
| `FileNotFoundError` | `predictions_json` does not exist | Check the path |
| `ValueError: must be a JSON array` | Predictions file is not a list | Wrap predictions in `[...]` |
| `ValueError: missing 'gt'/'response'/'video_id'` | A prediction item is missing a required field | Inspect and fix the predictions JSON |
| Samples silently skipped | `response` or `gt` contains both or neither 'yes'/'no' | Check logs for warnings; inspect those samples |
すべてのファイル
6件のファイルtao-analyze-gaps-vlm-bcqをインストール
スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。
ZIPをダウンロードリポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。
git clone https://github.com/NVIDIA/skills/tree/main/skills/tao-analyze-gaps-vlm-bcq # Copy SKILL.md to your .claude/skills/ directory
コピー





家
