Skip to content

Commit f043dd2

Browse files
committed
feat: add dataset-management skill, update sam2-segmentation and skills.json
- New skill: skills/annotation/dataset-management/ with deploy scripts - Update sam2-segmentation SKILL.md - Update skills.json with new entries
1 parent b15a40c commit f043dd2

7 files changed

Lines changed: 535 additions & 2 deletions

File tree

skills.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,34 @@
227227
"capabilities": [
228228
"interactive_segmentation",
229229
"video_tracking"
230+
]
231+
},
232+
{
233+
"id": "annotation-data",
234+
"name": "Annotation Data",
235+
"description": "Dataset annotation management — COCO labels, sequences, export, and Kaggle upload for Annotation Studio.",
236+
"version": "1.0.0",
237+
"category": "annotation",
238+
"path": "skills/annotation/dataset-management",
239+
"tags": [
240+
"annotation",
241+
"dataset",
242+
"coco",
243+
"labeling"
244+
],
245+
"platforms": [
246+
"linux-x64",
247+
"linux-arm64",
248+
"darwin-arm64",
249+
"darwin-x64",
250+
"win-x64"
251+
],
252+
"requirements": {
253+
"python": ">=3.9"
254+
},
255+
"capabilities": [
256+
"dataset_management",
257+
"coco_export"
230258
],
231259
"ui_unlocks": [
232260
"annotation_studio"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: annotation-data
3+
description: "Dataset annotation management — COCO labels, sequences, export, and Kaggle upload"
4+
version: 1.0.0
5+
entry: scripts/annotation_manager.py
6+
deploy: deploy.sh
7+
8+
parameters:
9+
- name: datasets_dir
10+
label: "Datasets Directory"
11+
type: string
12+
default: ""
13+
description: "Root directory for annotation datasets (auto-detected if empty)"
14+
group: Storage
15+
16+
capabilities:
17+
live_transform:
18+
script: scripts/annotation_manager.py
19+
description: "Dataset CRUD, annotation save/load, COCO export"
20+
21+
ui_unlocks:
22+
- annotation_studio
23+
---
24+
25+
# Annotation Data Management
26+
27+
Manages annotation datasets for Aegis Annotation Studio. Handles dataset CRUD, label management, COCO-format export, and Kaggle upload.
28+
29+
## Protocol (stdin/stdout JSONL)
30+
31+
### Aegis → Skill
32+
```jsonl
33+
{"command": "list_datasets", "request_id": "req_001"}
34+
{"command": "get_dataset", "name": "my_dataset", "request_id": "req_002"}
35+
{"command": "save_dataset", "name": "my_dataset", "labels": [...], "request_id": "req_003"}
36+
{"command": "delete_dataset", "name": "my_dataset", "request_id": "req_004"}
37+
{"command": "save_annotation", "dataset": "my_dataset", "frame_id": "f1", "annotations": [...], "request_id": "req_005"}
38+
{"command": "list_labels", "dataset": "my_dataset", "request_id": "req_006"}
39+
{"command": "export_coco", "dataset": "my_dataset", "request_id": "req_007"}
40+
{"command": "get_stats", "dataset": "my_dataset", "request_id": "req_008"}
41+
{"command": "stop"}
42+
```
43+
44+
### Skill → Aegis
45+
```jsonl
46+
{"event": "annotation", "type": "ready", "request_id": "", "data": {"version": "1.0.0"}}
47+
{"event": "annotation", "type": "datasets", "request_id": "req_001", "data": [...]}
48+
{"event": "annotation", "type": "dataset", "request_id": "req_002", "data": {...}}
49+
{"event": "annotation", "type": "saved", "request_id": "req_005", "data": {"frame_id": "f1", "count": 3}}
50+
{"event": "annotation", "type": "exported", "request_id": "req_007", "data": {"path": "/path/to/coco.json"}}
51+
```
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@echo off
2+
REM deploy.bat — Bootstrapper for Annotation Data Management Skill (Windows)
3+
REM Lightweight — no GPU needed, stdlib-only Python.
4+
5+
setlocal enabledelayedexpansion
6+
7+
set "SKILL_DIR=%~dp0"
8+
if "%SKILL_DIR:~-1%"=="\" set "SKILL_DIR=%SKILL_DIR:~0,-1%"
9+
set "VENV_DIR=%SKILL_DIR%\.venv"
10+
set "LOG_PREFIX=[annotation-data-deploy]"
11+
12+
REM ─── Find Python ───────────────────────────────────────────────────────
13+
set "PYTHON_CMD="
14+
for %%V in (3.12 3.11 3.10 3.9) do (
15+
if not defined PYTHON_CMD (
16+
py -%%V --version >nul 2>&1
17+
if !errorlevel! equ 0 set "PYTHON_CMD=py -%%V"
18+
)
19+
)
20+
if not defined PYTHON_CMD (
21+
python3 --version >nul 2>&1
22+
if !errorlevel! equ 0 set "PYTHON_CMD=python3"
23+
)
24+
if not defined PYTHON_CMD (
25+
python --version >nul 2>&1
26+
if !errorlevel! equ 0 set "PYTHON_CMD=python"
27+
)
28+
if not defined PYTHON_CMD (
29+
echo %LOG_PREFIX% ERROR: No Python found>&2
30+
echo {"event": "error", "stage": "python", "message": "No Python found"}
31+
exit /b 1
32+
)
33+
34+
for /f "tokens=*" %%A in ('!PYTHON_CMD! --version 2^>^&1') do set "PY_VERSION=%%A"
35+
echo %LOG_PREFIX% Using Python: %PYTHON_CMD% (%PY_VERSION%)>&2
36+
echo {"event": "progress", "stage": "python", "message": "Found %PY_VERSION%"}
37+
38+
REM ─── Create venv ───────────────────────────────────────────────────────
39+
if not exist "%VENV_DIR%\Scripts\python.exe" (
40+
%PYTHON_CMD% -m venv "%VENV_DIR%"
41+
)
42+
43+
echo {"event": "progress", "stage": "venv", "message": "Virtual environment ready"}
44+
45+
REM ─── Verify ────────────────────────────────────────────────────────────
46+
"%VENV_DIR%\Scripts\python.exe" -c "import json, pathlib; print('Annotation data skill ready')" 2>&1
47+
48+
echo {"event": "complete", "backend": "cpu", "message": "Annotation data skill installed"}
49+
echo %LOG_PREFIX% Done!>&2
50+
51+
endlocal
52+
exit /b 0
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
# deploy.sh — Bootstrapper for Annotation Data Management Skill
3+
# Lightweight — no GPU needed, stdlib-only Python.
4+
5+
set -euo pipefail
6+
7+
SKILL_DIR="$(cd "$(dirname "$0")" && pwd)"
8+
VENV_DIR="$SKILL_DIR/.venv"
9+
LOG_PREFIX="[annotation-data-deploy]"
10+
11+
log() { echo "$LOG_PREFIX $*" >&2; }
12+
emit() { echo "$1"; }
13+
14+
# ─── Find Python ──────────────────────────────────────────────────────────
15+
find_python() {
16+
for cmd in python3.12 python3.11 python3.10 python3.9 python3; do
17+
if command -v "$cmd" &>/dev/null; then
18+
local ver
19+
ver="$("$cmd" --version 2>&1 | grep -oE '[0-9]+\.[0-9]+')"
20+
local major minor
21+
major=$(echo "$ver" | cut -d. -f1)
22+
minor=$(echo "$ver" | cut -d. -f2)
23+
if [ "$major" -ge 3 ] && [ "$minor" -ge 9 ]; then
24+
echo "$cmd"
25+
return 0
26+
fi
27+
fi
28+
done
29+
return 1
30+
}
31+
32+
PYTHON_CMD=$(find_python) || {
33+
log "ERROR: No Python >=3.9 found."
34+
emit '{"event": "error", "stage": "python", "message": "No Python >=3.9 found"}'
35+
exit 1
36+
}
37+
38+
log "Using Python: $PYTHON_CMD ($($PYTHON_CMD --version 2>&1))"
39+
emit "{\"event\": \"progress\", \"stage\": \"python\", \"message\": \"Found $($PYTHON_CMD --version 2>&1)\"}"
40+
41+
# ─── Create venv ──────────────────────────────────────────────────────────
42+
if [ ! -d "$VENV_DIR" ]; then
43+
"$PYTHON_CMD" -m venv "$VENV_DIR"
44+
fi
45+
46+
emit '{"event": "progress", "stage": "venv", "message": "Virtual environment ready"}'
47+
48+
# ─── Verify ───────────────────────────────────────────────────────────────
49+
"$VENV_DIR/bin/python" -c "import json, pathlib; print('Annotation data skill ready')" 2>&1 | while read -r line; do log "$line"; done
50+
51+
emit '{"event": "complete", "backend": "cpu", "message": "Annotation data skill installed"}'
52+
log "Done!"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Annotation Data Management — minimal deps (stdlib only)
2+
# No external packages needed — all Python stdlib

0 commit comments

Comments
 (0)