tao-analyze-gaps-vlm-bcq
NVIDIA/skills
Extraer los resultados falsos positivos y falsos negativos de las predicciones de las preguntas de clasificación binaria de VLM comparando las respuestas del modelo con los datos de referencia, generando un archivo JSONL estructurado y un informe resumido para el análisis posterior de las causas fundamentales.
...Expandir todoAnálisis de brechas en la clasificación binaria de VLM
Lee un archivo JSON con las predicciones de VLM, compara cada respuesta del modelo con la verdad de referencia y escribe los casos de fallo (FP/FN) en un archivo JSONL junto con un informe resumido.
Objetivo
Tras ejecutar un VLM en una tarea de evaluación binaria de tipo «sí/no», es necesario comparar las predicciones con la verdad de referencia para identificar los casos de fallo. Esta habilidad genera una lista estructurada de muestras de FP (falsos positivos) y FN (falsos negativos) que las etapas posteriores de RCCA (por ejemplo, la generación de cosmos o el análisis de la causa raíz) utilizan para impulsar una iteración DEFT.
Uso
Invoque la acción `vlm_bcq ` dentro del contenedor de servicios de datos de TAO Toolkit con sustituciones de tipo «clave=valor» al estilo Hydra:
gap_analysis vlm_bcq \
predictions_json=/path/to/results.json \
results_dir=/path/to/output/gaps
Incluye «videos_dir» cuando los valores de «video_id» en las predicciones sean rutas relativas:
gap_analysis vlm_bcq \
predictions_json=/path/to/results.json \
results_dir=/path/to/output/gaps \
videos_dir=/path/to/videos/root
Tras la ejecución, extrae los recuentos de FP/FN de kpi_gaps_report.txt y dirige las etapas posteriores a kpi_gaps.jsonl.
Entradas
- predictions_json: Ruta al archivo JSON de predicciones. Debe ser un array JSON en el que cada elemento contenga los campos
video_id,responseygt.Los campos responseygtse analizan mediante coincidencia de límites de palabra: se reconoce«yes»o«no»en cualquier parte de la cadena. Las muestras en las que ambos estén presentes o ninguna de las dos se omiten con una advertencia. - videos_dir (opcional): Directorio base para resolver las rutas relativas
de video_id. Si se omite, los valoresde video_idse utilizan como rutas absolutas.
Formato JSON de las predicciones:
[
{
"video_id": "/path/to/video.mp4",
"response": "Sí, hay una colisión.",
"gt": "B. No",
"question": "¿Hay una colisión?"
}
]
Resultados
- kpi_gaps.jsonl: Un objeto JSON por línea para cada caso de FP/FN. Campos:
video_id(ruta absoluta),error_type(FPoFN),question,ground_truth,response. - kpi_gaps_report.txt: Tabla legible para el ser humano con los recuentos totales de FP/FN.
Si no se detectan discrepancias, no se escriben archivos y se registra un mensaje.
Parámetros clave
| Parámetro | Obligatorio | Descripción |
|---|---|---|
| predictions_json | Sí | Ruta al archivo JSON de predicciones |
| results_dir | Sí | Directorio de salida; se crea si no existe |
| videos_dir | No | Directorio base para resolver las rutas relativas de video_id |
Patrones de error
| Error | Causa | Solución |
|---|---|---|
FileNotFoundError |
El archivo«predictions_json» no existe |
Comprueba la ruta |
ValueError: debe ser una matriz JSON |
El archivo de predicciones no es una lista | Envuelve las predicciones entre [...] |
ValueError: faltan «gt»/«response»/«video_id» |
A un elemento de predicción le falta un campo obligatorio | Revisa y corrige el JSON de predicciones |
| Las muestras se han omitido sin aviso | «response» o «gt» contienen ambos o ninguno de «yes»/«no» |
Comprueba si hay advertencias en los registros; revisa esas muestras |
---
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 |
Todos los archivos
6 archivosInstalar tao-analyze-gaps-vlm-bcq
Descarga y descomprime los archivos de habilidades en tu directorio .claude/skills/.
Descargar ZIPClona el repositorio y copia los archivos de la habilidad a tu proyecto.
git clone https://github.com/NVIDIA/skills/tree/main/skills/tao-analyze-gaps-vlm-bcq # Copy SKILL.md to your .claude/skills/ directory
Copiar





Hogar
