Logo Tao Analyze Detection Kpi

Tao Analyze Detection Kpi

Tổ chức
NVIDIA-TAO
tao-analyze-detection-kpi

Chạy phân tích KPI của TAO Data Services cho bài toán phát hiện đối tượng: so sánh các nhãn dự đoán từ inference với ground truth để tính TP/FP/FN/TN, precision, recall, accuracy và AP theo từng lớp tại một ngưỡng IoU cố định. Dùng khi quy trình phát hiện đối tượng cần báo cáo mAP theo từng lớp sau inference, hoặc khi người dùng yêu cầu "run KPI analyze", "compute detection mAP" hoặc "score my OD predictions against ground truth".

Add to TypingMind

Tổng quan

Nhà phát hànhNVIDIA-TAO
Kho mãtao-skill-bank
Tên kỹ năngtao-analyze-detection-kpi
Sao
98
Bản fork
28
Tệp đi kèm
6
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 6 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được NVIDIA-TAO công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Tao Analyze Detection Kpi trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/NVIDIA-TAO/tao-skill-bank/tree/main/skills/data/tao-analyze-detection-kpi
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NVIDIA-TAO/tao-skill-bank.git /tmp/tao-skill-bank
mkdir -p .claude/skills
cp -r /tmp/tao-skill-bank/skills/data/tao-analyze-detection-kpi .claude/skills/tao-analyze-detection-kpi
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Tao Analyze Detection Kpi trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Tao Analyze Detection Kpi ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Tao Analyze Detection Kpi với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

TAO Analyze Detection KPI

Use this skill to run TAO Data Services KPI analysis for object detection. The skill compares inference annotations against ground truth over one or more KPI sources and writes a per-class metrics CSV. It does not run inference; an upstream step must produce the inference annotations first.

The container entrypoint is:

bash
analytics kpi_analyze -e /absolute/path/to/kpi_analyze.yaml

Inputs

The user provides either a finished spec or the paths to fill into the template.

Required spec fields:

FieldMeaning
data.input_formatKITTI or COCO. Uppercase — see Pitfalls.
data.kpi_sourcesList of sources. Each entry requires image_dir, ground_truth_ann_path, and inference_ann_path; all three are asserted at startup.
data.mappingPath to a class-mapping YAML: a list of single-key dicts whose value is a LIST of aliases. See assets/example_mapping.yaml — a bare string here silently zeroes every metric.
results_dirOutput directory for kpi_calc.csv.

Common optional fields. The Default column is what TAO DS uses when the field is absent; assets/default_kpi_analyze.yaml already carries the recommended value for each, so filling the template needs none of them changed:

FieldDefaultMeaning
kpi.iou_threshold0.5IoU at or above which a prediction counts as a true positive.
kpi.conf_threshold0.5Predictions below this are dropped. The template uses 0.0, which keeps the whole PR curve so a threshold can be swept afterwards without re-running inference. On the pinned image that is safe: unmatched ground truth carries a -1.0 sentinel and lands in FN at any threshold. On a build predating that fix, 0.0 scored every missed box as a true positive — TP became the ground-truth count and FN was always 0 — so use a small positive value there.
kpi.num_recall_points11Recall points for the interpolated PR curve. The template keeps 101 (COCO-style), matching the reference ITS pipeline. 11 selects VOC-style sampling and reports different numbers for the same detections.
kpi.ignore_sqwidth0Boxes narrower than this are ignored. The template keeps 0, matching the reference ITS pipeline, which scores every box. A higher value raises AP by dropping the hardest detections rather than by detecting them.
kpi.filterfalseEnable source filtering.
kpi.is_internalfalseWhen true, drops every class except person and appends a Summary row.
visualize.platformlocallocal writes a PR-curve plot into results_dir; wandb logs a run and table instead.
visualize.tagnullTag recorded on every row.

For a Grounding DINO loop, inference_ann_path is the labels/ directory TAO inference writes under {results_dir}/inference/labels/, and input_format is KITTI.

The default template is assets/default_kpi_analyze.yaml.

Quick Start

Run from the tao-skill-bank repo root.

Write the spec into the results directory. The run does not retain it, so a completed run otherwise cannot tell you which settings produced kpi_calc.csv. Keeping them together makes the result reproducible from the run alone.

bash
RESULTS_DIR=/absolute/path/for/this/run          # results_dir in the spec
SPEC="$RESULTS_DIR/kpi_analyze.yaml"        # spec lives beside its outputs
RUN_ROOT=/absolute/path/that/contains/images/annotations/and/results

python3 skills/data/tao-analyze-detection-kpi/scripts/verify_kpi_analyze_spec.py \
  --spec "$SPEC"

DS_IMAGE="$(scripts/resolve_versions_key.py images.tao_toolkit.data_services)"

docker run --rm --gpus all --ipc=host --network=host \
  -v "$RUN_ROOT:$RUN_ROOT" \
  -w "$RUN_ROOT" \
  "$DS_IMAGE" \
  analytics kpi_analyze -e "$SPEC"

Pass --gpus all even though the analysis itself is CPU-only. The TAO launcher calls nvidia-smi -L unconditionally before dispatching any subtask, so a container started without GPU access dies with FileNotFoundError: 'nvidia-smi' before kpi_analyze runs.

Do not pass --user $(id -u):$(id -g); some TAO DS images call getpass.getuser() at startup and fail when the UID is not in /etc/passwd.

Generate A Spec

If the user provides paths instead of a ready spec, copy the template and fill in the nulls. Every tuning value it already carries is the one this stage wants — change one only deliberately.

bash
cp skills/data/tao-analyze-detection-kpi/assets/default_kpi_analyze.yaml "$SPEC"

Fill data.kpi_sources (one entry per source), data.mapping and results_dir, all as absolute paths, then validate:

bash
python3 skills/data/tao-analyze-detection-kpi/scripts/verify_kpi_analyze_spec.py --spec "$SPEC"
yaml
data:
  input_format: KITTI
  kpi_sources:
  - image_dir: /absolute/path/kpi/images               # no trailing slash
    ground_truth_ann_path: /absolute/path/kpi/labels
    inference_ann_path: /absolute/path/results/inference/labels
  mapping: /absolute/path/mapping.yaml
results_dir: /absolute/path/results/analyze_kpi

The template is the only place a default value lives, so nothing can disagree with it. verify reports the three settings that change what the numbers mean — conf_threshold, num_recall_points, ignore_sqwidth — so the spec that ran is recoverable from its output.

Preflight

  1. Verify Docker access:
bash
docker info > /dev/null
  1. Resolve and pull the data-services image if needed:
bash
DS_IMAGE="$(scripts/resolve_versions_key.py images.tao_toolkit.data_services)"
docker image inspect "$DS_IMAGE" > /dev/null || docker pull "$DS_IMAGE"
  1. Validate the spec:
bash
python3 skills/data/tao-analyze-detection-kpi/scripts/verify_kpi_analyze_spec.py --spec "$SPEC"
  1. Confirm RUN_ROOT contains the spec, every image_dir, both annotation paths per source, the mapping file, and the results directory. Mount RUN_ROOT to the same absolute path inside Docker.

Outputs

ArtifactLocation
Per-class metrics CSVresults_dir/kpi_calc.csv
PR curve plotresults_dir/ (only when visualize.platform: local)

kpi_calc.csv columns: Sequence Name, TP, FP, FN, TN, Pr, Re, Acc, AP — one row per sequence per class. A per-class result table and the aggregate mAP are also printed to stdout; capture the log if the caller needs the mAP value, since it is not written to the CSV.

Pitfalls

Ground truth may be 15- or 16-field KITTI. The parser names 15 columns for ground truth and 16 for predictions, but reads with index_col=False, so a trailing conf_score on a GT file is truncated rather than shifted. Feeding GT straight from tooling that writes a score column is fine — verified byte-identical results either way. The ParserWarning about "length of header or names does not match length of data" describes exactly that truncation and is not a sign of corruption.

input_format is uppercase here. analytics kpi_analyze accepts only KITTI or COCO. This differs from gap_analysis object_detection, which takes lowercase kitti / coco. Passing lowercase to this action fails to construct the data object.

Sequence Name is derived from the path, not configured. It is image_dir.split('/')[-2] — the second-to-last component of image_dir. A trailing slash or a flat image directory shifts which component is picked, so two sources can collide under one name. Lay out image_dir so that component is the sequence identifier you want.

data.mapping values are LISTS of aliases, not strings. This is the single most destructive thing to get wrong: the file is a YAML list of single-key dicts whose value is a list of source names that fold into that canonical class.

yaml
- bicycle:
    - Bicycle
    - Motorcycle
    - bicycle
    - twowheeler
- car:
    - car
    - Heavy Truck
    - Vehicle

construct_category_map stores the value verbatim (cat_map[k] = v), so writing - car: car — a bare string — yields a value that downstream code iterates character by character. Class matching then fails for every box, and the run still exits 0: the result is TP=0, FN=0, every prediction counted a false positive, and mAP: 0.0, with no error and no warning.

The tell is a perfect-looking run with all-zero metrics. Sanity-check by scoring a ground-truth set against a copy of itself — with a correct mapping that returns TP = every box and mAP: 1.0; anything else means the mapping, not the model.

data.mapping is required. The Hydra schema marks it mandatory even though the underlying category-map builder can derive classes from the label directory when it is absent. Supply the YAML.

Two different conf_threshold defaults. The dataclass default is 0.5, the shipped spec template uses 0.0. Whichever you rely on, set it explicitly — an unset value silently changes which predictions are scored.

is_internal: true is destructive to the report. It drops every class except person and appends a Summary row. Leave it false unless you specifically want the internal person-only KPI.

Troubleshooting

<key> not found in kpi_sources: every source entry needs all three of image_dir, ground_truth_ann_path, inference_ann_path.

Paths not found inside Docker: use a RUN_ROOT mount where host and container paths are identical, and confirm the images and annotation directories are under that mount.

Empty or all-zero metrics: usually conf_threshold above the model's score range, or an input_format that does not match the annotations on disk.

wandb errors or hangs: set visualize.platform: local to write a PR-curve plot instead of logging to wandb.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Tao Analyze Detection Kpi làm được gì?

Chạy phân tích KPI của TAO Data Services cho bài toán phát hiện đối tượng: so sánh các nhãn dự đoán từ inference với ground truth để tính TP/FP/FN/TN, precision, recall, accuracy và AP theo từng lớp tại một ngưỡng IoU cố định. Dùng khi quy trình phát hiện đối tượng cần báo cáo mAP theo từng lớp sau inference, hoặc khi người dùng yêu cầu "run KPI analyze", "compute detection mAP" hoặc "score my OD predictions against ground truth".

Vì sao nên dùng Tao Analyze Detection Kpi trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Tao Analyze Detection Kpi là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Tao Analyze Detection Kpi trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/NVIDIA-TAO/tao-skill-bank/tree/main/skills/data/tao-analyze-detection-kpi. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Tao Analyze Detection Kpi?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Tao Analyze Detection Kpi với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Tao Analyze Detection Kpi với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Tao Analyze Detection Kpi có miễn phí không?

Có. Kỹ năng này được NVIDIA-TAO phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇