本文へ移動
cccskills
無料GitHub で公開

getpixelvideo-tracking-loader

Use when importing SAM3 or YOLO tracking CSV files into getpixelvideo, including bbox-to-marker anchor conversion.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md9.4 KB

SKILL.md(原文)

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

getpixelvideo Smart Tracking-CSV Loader (vailá)

Use when the user works on vaila/getpixelvideo.py Load Tracking CSV, needs to import SAM3 / YOLO tracking files as editable markers, mentions bbox → marker anchor conversion (center / bottom / top / left / right), or hits a “Frame column not found” error in the legacy loader.

vailá maintenance rule (version/date)

Whenever you edit vaila/getpixelvideo.py (or any *.py in repo), also update:

  • script header Update Date (today) + Version (global, from vaila.py header/banner)
  • root README.md line Last updated: YYYY-MM-DD
  • help docs: vaila/help/getpixelvideo.md + .html, plus vaila/help/index.md
    • .html (“Generated on”)
  • installers / vaila.py if change impacts install/run UX

Reference checklist: AGENTS.md § Mandatory: Update metadata on any script change.


What the smart loader does (v0.3.54+)

The Load Tracking CSV button in getpixelvideo.py used to fail whenever a file did not have a literal Frame column or used vailá’s own SAM3 / YOLO export schema. The smart loader auto-detects 5 formats and offers a bbox → marker anchor conversion so the data can be edited like any other vailá marker set.

Supported formats (auto-detected)

Format keyTypical fileNotes
sam_pointssam_points.csvPoint markers, loads directly
sam_trackssam_tracks.csv (or sam_bbox_tracks.csv alias)Long bbox+area per (frame, obj_id)
sam_frames_metasam_frames_meta.csvPer-frame meta with normalised bbox (xc, yc, w, h ∈ [0,1])
yolo_multiall_id_detection.csvOne row per detection, multi-id
yolo_singleperson_id_NN.csvSingle-id YOLO export
sapiens_pose_long*_sapiens_vaila.csvSapiens2 long pose; prompt for person_id
sapiens_trackssapiens_tracks.csv (legacy)stable_id + x1..y2 bbox rows
sam_trackssapiens_bbox_tracks.csvSame SAM schema as sam_tracks.csv

Sapiens2 wide pose (308 kp): use the regular Load button on <stem>_id_NN_sapiens_pose.csv or <stem>_getpixelvideo_pose.csv from vaila/vaila_sapiens.py — not the Load Tracking CSV button.

Anything unrecognised falls back to the legacy YOLO parser, so old files still load.

Save behaviour (v0.3.55)

After a successful anchor conversion, the loader sets bbox_converted_to_markers = True. The Save button is then routed to the regular save_coordinates writer (vailá *_markers.csv) and does NOT trigger export_labeling_dataset — the legacy bbox-to-YOLO export path. Why this matters: export_labeling_dataset extracts every annotated frame to disk; on a 16k-frame broadcast clip with 248k bboxes that froze the pygame loop for tens of minutes and users were forced to sudo kill -9 the process.

If you want the YOLO dataset export instead, answer the anchor prompt with Enter (skip conversion, bboxes stay as overlay only); Save will then go through the dataset exporter.

save_coordinates itself is vectorised (NumPy bulk assignment instead of per-cell df.at[] loops). The same 248k-bbox case writes in ~0.5 s.

Terminal feedback for ML dataset saves (v0.3.55, later same day)

The YOLO dataset writers are legitimately slow — they extract + re-encode every annotated frame. While Python is blocked the pygame window appears frozen. Three helpers in vaila/getpixelvideo.py give the user terminal visibility:

  • _save_banner(title, detail) — =-boxed banner before each save begins with destination + counts. Prefix is >> not [...] because absl logging (installed by mediapipe / opencv on import) silently eats bracketed prefixes from stdout. The symptom is confusing because inspect.getsource() still shows the original [...] code but the output is missing the prefix. tqdm writes to stderr so its desc=... brackets are unaffected.
  • _save_done(message) — single-line completion tail.
  • _try_import_tqdm() — soft import. tqdm is already a transitive dep via ultralytics / pytorch.

Wired into export_labeling_dataset (YOLO detection), export_pose_dataset (YOLO pose), and _export_all_labels_view. Each writer shows a tqdm bar per train/val/test split.

Anchor prompt (bbox formats)

After detecting a bbox format, load_tracking_csv populates tracking_data for overlay and then asks (via show_input_dialog):

1 = center      (default if you just type "center")
2 = bottom      (good for foot contact / ground contact studies)
3 = top         (head reference)
4 = left
5 = right
Enter = skip conversion, keep bbox overlay only

Choosing an anchor calls bboxes_to_marker_coordinates(bboxes, total_frames, anchor) which builds the regular coordinates: dict[int, list] plus a labels vector. From that moment on the data behaves exactly like any other marker set: editable, TAB-navigable, saveable.


Public API (single-source-of-truth)

FunctionPurpose
_BBOX_ANCHOR_ALIASESMaps friendly names + numeric shortcuts to canonical anchor keys
_anchor_xy_from_bbox(x1, y1, x2, y2, anchor)Returns (x, y) int pixel for the chosen anchor
_detect_frame_col(columns)Case-insensitive locator for the frame column
_detect_tracking_format(df)Returns one of sam_tracks / sam_frames_meta / sam_points / yolo_multi / yolo_single / sapiens_pose_long / sapiens_tracks / unknown
_sapiens_long_to_marker_df(df, person_id, kpt_thr)Pivot Sapiens2 long CSV to wide marker layout
_iter_bboxes_from_df(df, fmt, video_width, video_height)Generator of uniform {frame, obj_id, x1, y1, x2, y2, label, score} dicts (normalised → pixel handled here)
bboxes_to_marker_coordinates(bboxes, total_frames, anchor)Build (coordinates, labels) from a list of bbox dicts
load_tracking_csv(...)Top-level loader; orchestrates detect → iterate → optional anchor prompt

Typical usage

GUI flow

  1. Launch uv run vaila.py → Frame C → Pixel Coordinate Tool, or uv run vaila/getpixelvideo.py -f /path/to/video.mp4.
  2. Click Load Tracking CSV.
  3. Pick sam_tracks.csv / sam_frames_meta.csv / all_id_detection.csv / etc.
  4. Anchor prompt appears (only for bbox formats). Type 1–5 or a friendly name. Press Enter to keep the overlay only (no marker creation).
  5. Edit / save the resulting markers as you would with any other set.

Headless / scripting

When integrating into other scripts:

from vaila.getpixelvideo import (
    _detect_tracking_format,
    _iter_bboxes_from_df,
    bboxes_to_marker_coordinates,
)

import pandas as pd

df = pd.read_csv("sam_tracks.csv")
fmt = _detect_tracking_format(df)          # "sam_tracks"
bboxes = list(_iter_bboxes_from_df(df, fmt, video_width=1920, video_height=1080))
coords, labels = bboxes_to_marker_coordinates(
    bboxes, total_frames=1189, anchor="bottom"
)

coords is the canonical vailá dict[int, list[(x, y)]] keyed by frame index, ready to feed save_markers or any downstream module.


Troubleshooting

“Frame column not found” but file looks correct

Old loader required exact Frame. The smart loader uses _detect_frame_col(columns) which accepts frame, Frame, FRAME, frame_id, frame_idx. If you still see the error you are on a pre-v0.3.54 copy → update getpixelvideo.py (header should say Version: 0.3.54).

Normalised bboxes appear in the wrong place

sam_frames_meta.csv stores bboxes as xc, yc, w, h ∈ [0, 1]. The loader converts them with the video’s actual width/height as read by OpenCV at load time. If you opened a different video before loading the CSV you’ll see the offset bug — switch to the matching video first.

Anchor prompt did not appear

Anchor prompt only fires for bbox formats. sam_points.csv is loaded directly as markers (no bbox, no anchor needed).


Tests

uv run pytest tests/test_sam_postprocess.py tests/test_vaila_sam.py -q

(No dedicated test module yet for getpixelvideo.py’s smart loader — the SAM postprocess tests cover the upstream sam_tracks.csv / sam_frames_meta.csv schemas that the loader consumes.)


Open follow-ups (see docs/sessions/2026-06-14-getpixel-sam3-crosschunk.md § 6.1)

  • Wire the toolbar “Load Tracking CSV” button through the same load_tracking_csv path so the anchor prompt also fires there (currently only the file-dialog code path does).
  • Expose --load-tracking-csv FILE --bbox-anchor center as CLI flags for headless conversion.
  • Persist the chosen anchor in the marker file metadata so re-opening picks up the same convention without re-asking.

Code map

FileRole
vaila/getpixelvideo.pyPixel coordinate GUI + smart loader
vaila/help/getpixelvideo.md / .htmlUser-facing help
vaila/vaila_sam.pyProduces sam_tracks.csv, sam_frames_meta.csv, sam_points.csv, sam_contours.json
vaila/sam_postprocess.pyConverts SAM3 batch output to vailá pixel CSVs
tests/test_sam_postprocess.pyValidates the SAM3 CSV schemas the loader consumes
docs/sessions/2026-06-14-getpixel-sam3-crosschunk.mdFull session history (read first on continuation)

レビュー

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

同じリポジトリのスキル

概要と使いどころ

Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for standard infrastructure monitoring unrelated to AI agents, or when the agent is not instrumented with OpenTelemetry (for Reliability, Cost, Safety, Security alerts). NOTE: Reliability, Cost, Safety, and Security alerts use generic OTel metrics and work across runtimes (such as Cloud Run, Vertex AI). Quality alerts rely on Vertex AI Online Monitors and are strictly bound to Vertex AI deployments.

日本語の概要は準備中です。原文の説明を表示しています。

vaila-multimodaltoolbox/vaila192026年10月8日 更新

Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available models, check if a specific model is deployable (`gcloud ai model-garden models list-deployment-config`), query deployment cost, troubleshoot deployment errors (like quota limits), or undeploy/clean up endpoints. Also use when copying and deploying a 1P Tuned Model. Don't use for pure listing/discovery questions of the form "is X deployed?", "list my endpoints", or "which regions have models running?" — for those use `agent-platform-endpoint-management`. Don't use for public Vertex AI deployments (use the `vertex-deploy` skill) or for running model evaluations (use the `agent-platform-eval-flywheel` skill).

日本語の概要は準備中です。原文の説明を表示しています。

vaila-multimodaltoolbox/vaila192026年10月8日 更新

Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for running model evaluations.

日本語の概要は準備中です。原文の説明を表示しています。

vaila-multimodaltoolbox/vaila192026年10月8日 更新

Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results before and after a fix, or when guidance is needed on Agent Platform eval methodology — including dataset schema, LLM-as-judge scoring, and common failure causes. For fine-tuning, use agent-platform-tuning. For general production deployment, use agent-platform-deploy.

日本語の概要は準備中です。原文の説明を表示しています。

vaila-multimodaltoolbox/vaila192026年10月8日 更新

Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate code for calling Gemini or OpenMaaS models, authenticate with GenAI SDK, OpenAI SDK, or legacy Agent Platform SDK, configure base URLs and global/regional endpoints, or troubleshoot 429 Resource Exhausted (DSQ), 400 User Validation, or 404 Not Found errors. Don't use for deploying models to endpoints or for running model evaluations.

日本語の概要は準備中です。原文の説明を表示しています。

vaila-multimodaltoolbox/vaila192026年10月8日 更新

Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry).

日本語の概要は準備中です。原文の説明を表示しています。

vaila-multimodaltoolbox/vaila192026年10月8日 更新

vaila-multimodaltoolbox のスキルをすべて見る

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