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. No",
"question": "충돌이 있습니까?"
}
]
출력
- kpi_gaps.jsonl: 각 FP/FN 사례마다 한 줄에 하나의 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
복사





집
