amc-run-sample-calibration
Run end-to-end calibration on the shipped sample dataset (sdg_08_2_sample_data_010926.zip) against a running AMC microservice. Use when user says 'test sample dataset', 'run sample calibration', 'verify AMC install', or 'launch and test'.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- amc-run-sample-calibration
- owner
- NVIDIA CORPORATION
- license
- Apache-2.0
- service
- auto-magic-calib
- version
- 1.0.0
- metadata
- { "tags": [ "amc", "calibration", "sample", "rest-api", "validation", "python" ] }
- reviewed
- 2026-04-28
- description
- Run end-to-end calibration on the shipped sample dataset (sdg_08_2_sample_data_010926.zip) against a running AMC microservice. Use when user says 'test sample dataset', 'run sample calibration', 'verify AMC install', or 'launch and test'.
- data_classification
- public
02 资源文件 5
- 参考文档BENCHMARK.md4.4 KB
- 参考文档evals/evals.json5.1 KB
- 脚本scripts/run_sample_calibration.py9.6 KB
- 参考文档skill-card.md3.6 KB
- 其他skill.oms.sig4.8 KB
03 SKILL.md 正文
Skill: Calibrate Sample Dataset
When to Use This Skill
Activate this skill when the user wants to sanity-check a running AMC stack with the bundled sample dataset. Typical prompts:
- "test the sample dataset" / "run sample calibration"
- "verify AMC install"
- "launch and test" (chain with
amc-setup-calibration-stackif the MS isn't already running)
Do NOT use this skill when:
- The user references their own video paths (e.g.
/data/videos/,cam_*.mp4not from the bundled zip) — route toamc-run-video-calibration. This skill is exclusively forassets/sdg_08_2_sample_data_010926.zip.
Prerequisite: AMC microservice running on a port in 8000-8009. If no backend is detected, delegate to amc-setup-calibration-stack first.
If execution cannot proceed in the current environment (no backend, missing sample data, etc.), surface the blocker AND describe the expected workflow + API sequence concisely so the user understands what will run once prerequisites are met. Do not fabricate calibration outputs, evaluation metrics, or trajectories.
Overview
Run a full calibration on the bundled sample dataset (sdg_08_2_sample_data_010926.zip, 4 synthetic warehouse cameras with ground truth) against a running AutoMagicCalib microservice. Useful for verifying that a freshly-launched stack works end-to-end before throwing real data at it.
The sample includes GT, so the run produces evaluation metrics (L2 distance, reprojection error) — no calibration parameter tuning needed.
Prerequisites
- [ ] AMC microservice running (follow
skills/amc-setup-calibration-stack/SKILL.mdif not) - [ ] Sample zip present at
assets/sdg_08_2_sample_data_010926.zip - [ ] Python 3 with
requestsavailable, or use the Swagger UI path below- The bundled script self-heals: if
requestsis missing it creates a throwaway venv under${TMPDIR:-/tmp}/amc-sample-test-venv(nothing written to the repo) - If
python3 -m venvitself fails withensurepip not available:sudo apt install -y python3-venv python3-pip
- The bundled script self-heals: if
Instructions
"launch AMC and test sample dataset" (or similar):
- Run
skills/amc-setup-calibration-stack/SKILL.mdfirst. - Wait for
/v1/readyto return OK. - Extract sample data (snippet below) — idempotent, safe to re-run.
- Run the bundled script in Run Script.
- Report final metrics + UI URL for manual inspection.
- VGGT refinement is attempted by default when the project reports
vggt_state: READY; otherwise the script explains that VGGT setup is optional and can be enabled later for refinement.
"test sample dataset" (MS already running):
- Detect backend: scan ports 8000–8009 for a
/v1/readyresponse. - If none → point to the setup skill.
- Extract sample data if not already cached.
- Run the bundled script.
- Report metrics.
Detect Running Backend
MS_PORT=""
for port in {8000..8009}; do
if curl -s "http://localhost:$port/v1/ready" | grep -q '"code":0'; then
MS_PORT=$port; break
fi
done
[ -z "$MS_PORT" ] && { echo "No running backend. Run amc-setup-calibration-stack skill first."; exit 1; }
echo "Backend on port $MS_PORT"
Locate + Extract Sample Data (idempotent)
export REPO_ROOT=$(git rev-parse --show-toplevel)
SAMPLE_ZIP="$REPO_ROOT/assets/sdg_08_2_sample_data_010926.zip"
[ -f "$SAMPLE_ZIP" ] || { echo "Sample zip not found at $SAMPLE_ZIP"; exit 1; }
# Cache directory next to the zip.
SAMPLE_DIR="$(dirname "$SAMPLE_ZIP")/.cache/sdg_08_2_sample_data_010926"
if [ ! -d "$SAMPLE_DIR" ]; then
mkdir -p "$SAMPLE_DIR"
unzip -q "$SAMPLE_ZIP" -d "$SAMPLE_DIR"
fi
ls "$SAMPLE_DIR"
# Expected (possibly inside a wrapper folder): alignment_data/ GT.zip videos/
Run Script
Run scripts/run_sample_calibration.py from the auto-magic-calib repo root, or set REPO_ROOT=/path/to/auto-magic-calib. The script reads compose/.env for the backend port, accepts BASE_URL, MS_PORT, SAMPLE_DIR, and RUN_VGGT overrides, creates a fresh project each run, attempts VGGT when ready, and prints the NGC warehouse dataset note at the end.
Alternative: Swagger UI Walkthrough
Agent shortcut: if the user explicitly requested a Swagger UI walkthrough (or said "no Python"), emit the table below and stop — do not invoke shell tooling, read other sections, or run the bundled Python script.
The microservice exposes an interactive OpenAPI UI at http://<HOST_IP>:<MS_PORT>/docs. If you prefer clicking through the API by hand:
-
Open
http://<HOST_IP>:<MS_PORT>/docsin a browser. -
Unzip
sdg_08_2_sample_data_010926.zipinto a cache directory next to it. -
Execute these endpoints in order, copying the
project_idfrom step 1 into subsequent paths:# Endpoint Body / Files 1 POST /v1/create_projectproject_name: any string2 POST /v1/upload_video_files/{project_id}files: upload all 4videos/cam_0*.mp4sorted by name3 POST /v1/upload_alignment/{project_id}alignment_file:alignment_data/alignment_data.json4 POST /v1/upload_layout/{project_id}layout_file:alignment_data/layout.png5 POST /v1/upload_gt_file/{project_id}gt_file:GT.zip6 POST /v1/verify_project/{project_id}— (expect project_state: READY)7 POST /v1/calibrate/{project_id}JSON: {"detector_type": "resnet"}8 GET /v1/get_project_info/{project_id}Refresh every ~10 s until project_state=COMPLETED9 GET /v1/result/{project_id}/evaluation_statisticsRead L2 distance + reprojection error 10 optional POST /v1/vggt/calibrate/{project_id}thenGET /v1/vggt_results/{project_id}/evaluation_statisticsRun only when vggt_stateisREADY; pollvggt_stateuntilCOMPLETED
This is the same sequence the bundled Python script runs, just executed manually. Step 10 is attempted by default when vggt_state is READY; otherwise it is skipped with setup guidance.
Status Fields from get_project_info
project_info.project_state is the AMC calibration lifecycle for the project. Poll it until it reaches COMPLETED (or stop on ERROR).
project_info.vggt_state is a per-project VGGT refinement lifecycle, a project-scoped status rather than a direct global service or model-load status. A newly created project can report vggt_state: "INIT" even when the VGGT model is present and mounted. The expected lifecycle is INIT → READY after AMC calibration completes → RUNNING while VGGT refinement runs → COMPLETED (or ERROR). Interpret INIT on a new or uncalibrated project as normal project state. If AMC calibration is complete and the project remains in a non-ready VGGT state, confirm VGGT setup and model availability with the setup skill checks and service logs.
Success Criteria
- Project reaches
project_state == "COMPLETED"within ~30 min. /v1/result/{id}/evaluation_statisticsreturns non-emptystatistics(GT was uploaded).- VGGT either runs to
vggt_state == "COMPLETED"and reports/v1/vggt_results/{id}/evaluation_statistics, or is skipped with setup guidance because the project is notREADYfor VGGT. - No
ERRORstate encountered.
Representative metrics for the sample (yours should be similar):
Average L2 distance(m) : < 1.5
Average reprojection error 0(px) : < 10
Key Output Files (on the server)
Results persist under $REPO_ROOT/projects/project_<project_id>/:
projects/project_<project_id>/
├── output/
│ ├── single_view_results/cam_XX/
│ │ ├── camInfo_hyper_XX.yaml
│ │ └── trajDump_Stream_0_3d.txt
│ └── multi_view_results/BA_output/results_ba/refined/
│ └── camInfo_XX.yaml # ← final calibration (use this)
└── calibration.log
Monitoring Progress
PROJECT_ID=<id_from_step_1>
REPO_ROOT=$(git rev-parse --show-toplevel)
tail -F --retry "$REPO_ROOT/projects/project_${PROJECT_ID}/calibration.log"
Or stream MS logs:
REPO_ROOT=$(git rev-parse --show-toplevel)
docker compose -f "$REPO_ROOT/compose/compose.yml" logs -f auto-magic-calib-ms
Troubleshooting
| Issue | Fix |
|---|---|
requests not installed |
Inside a venv: python3 -m venv venv && ./venv/bin/pip install requests. If python3 -m venv fails: sudo apt install -y python3-venv python3-pip first |
[2] Uploaded N videos where N >> 4 |
SAMPLE_DIR resolved to the repo root (or another over-broad path) and rglob("cam_*.mp4") swept stale videos from .cache/, projects/, etc. Stop the run (POST /v1/stop_calibration/{id}), delete the project (DELETE /v1/delete_project/{id}), set SAMPLE_DIR explicitly to the extracted sample dir, re-run. The script anchors on videos/ and asserts len(videos) <= 16 to fail loud |
verify_project returns state != READY |
Confirm all 4 videos + alignment + layout + GT uploaded; inspect GET /v1/get_project_info/{id} response |
| Sample not extracted | unzip <repo_root>/assets/sdg_08_2_sample_data_010926.zip -d <repo_root>/assets/.cache/sdg_08_2_sample_data_010926/ |
cam_*.mp4 glob finds 0 files |
Check wrapper-folder depth: find <sample_dir> -name "cam_*.mp4" |
| Calibration times out (>60 min) | Check calibration.log for "insufficient tracklets"; see root README.md guidelines on input videos |
| Upload returns 413 | Raise server upload limit, or split files (sample files are <200 MB total so this is unusual) |
| Port scan finds no backend | Backend not running — run amc-setup-calibration-stack skill |
Additional Sample Dataset
The root README.md also documents nv_warehouse_032326.zip, a real-world warehouse dataset available from NGC. Download it with ngc registry resource download-version "nvidia/amc-nv-warehouse"; then use amc-run-video-calibration, upload nv_warehouse_config.json in the config step, and run with the transformer detector. It does not include ground-truth data.
Related Skills
skills/amc-setup-calibration-stack/SKILL.md— launch MS + UI (prerequisite).skills/amc-run-video-calibration/SKILL.md— run calibration on your own pre-recorded MP4s.
Root README.md "Sample Data Setup" and "Calibration Workflow (UI)" sections cover the human-oriented path through the same sample.
<!-- signing marker -->
04 同仓库更多 Skills
youtube-clipper
YouTube 视频智能剪辑工具。下载视频和字幕,AI 分析生成精细章节(几分钟级别), 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频,并生成总结文案。 使用场景:当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词:视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video
viem-integration
Integrate EVM blockchains using viem. Use when user says "read blockchain data", "send transaction", "interact with smart contract", "connect to Ethereum", "use viem", "use wagmi", "wallet integration", "viem setup", or mentions blockchain/EVM development with TypeScript.
v4-security-foundations
Security-first Uniswap v4 hook development. Use when user mentions "v4 hooks", "hook security", "PoolManager", "beforeSwap", "afterSwap", or asks about V4 hook best practices, vulnerabilities, or audit requirements.
v4-sdk-integration
App-layer SDK guide for building swap and liquidity experiences directly with the Uniswap v4 SDK. Use when user asks about "v4 sdk", "uniswap v4", "v4 swap", "v4 liquidity", "PoolManager", "V4Planner", "StateView", "PositionManager", "pool state", "v4 position", "uniswap sdk", or when building swap/liquidity UX directly with SDKs rather than via the Trading API.
v4-hook-generator
Generate Uniswap v4 hook contracts via OpenZeppelin MCP. Use when building custom swap logic, async swaps, hook-owned liquidity, custom curves, dynamic fees, MEV protection, limit orders, or oracle hooks.
testing
For testing with Light Protocol programs and clients on localnet, devnet, and mainnet validation.