EGOHOME アノテーションのサンプル
左右の手の動作アノテーション
操作画面は日本語ですが、動作ラベルは記録時の英語で表示しています。ダウンロードには英語の原文と中国語訳が含まれます。表示言語を切り替えても API の入出力は変わりません。
シンクでのすすぎ
17.20 s30 fps · 左手 / 右手
アノテーションのタイムライン0.00 / 17.20 s
Segment左手右手
0 s17.20 s
They move the bottle toward the dish rack and place it there among the other dishes, then withdraw their hands.
左手 4
右手 3
Pose はモデルが推定した手のキーポイントです。3D 表示は手首を基準とし、既定のカメラ内部パラメータを使用します。実寸の測定には使えません。
評価データの出典:EgoHome · PerceptronAI ↗ · 36ec34a731cc_010 · 元の動画 32.4–49.6 s
評価利用の許諾に基づいて掲載しています。再生用の動画はリサイズし、音声を除いています。抜粋は記録されたセグメントの境界に沿って切り出しています。時刻は抜粋の開始位置が基準です。 Datumwell Annotation の予測には参照ラベルを入力していません。これらのサンプルはベンチマーク全体の成績を示すものではありません。動作と時刻は元の動画でご確認ください。 CC BY-NC 4.0 · 評価利用の許諾
2D / 3D Pose JSON をダウンロード ↓評価結果の JSON をダウンロード ↓API で動画をアノテーション
左右の手ごとに動作タイムラインを取得できます。上のサンプルには英語の説明と中国語訳が含まれています。
MP4 / MOV / WebM · 固定 30 fps
最大 50 MB の動画を非公開オブジェクトストレージに直接アップロードします。
annotation:write · annotation:read
Python 3 / 再開可能なアップロード
export ROBOROUTER_TOKEN='YOUR_API_TOKEN'
python3 - <<'PY'
import hashlib, json, os, sys, time, uuid
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
video = Path("clip.mp4")
data = video.read_bytes()
key_file = video.with_suffix(video.suffix + ".request-id")
try:
with key_file.open("x", encoding="ascii") as saved:
saved.write(str(uuid.uuid4()))
except FileExistsError:
pass
job_id = str(uuid.UUID(key_file.read_text(encoding="ascii").strip()))
base = "https://datumwell.io/api/v1/annotations/" + job_id
headers = {"Authorization": "Bearer " + os.environ["ROBOROUTER_TOKEN"]}
print("Request ID:", job_id, file=sys.stderr)
def request(path, method="GET", data=None, content_type=None):
fields = dict(headers)
if content_type:
fields["Content-Type"] = content_type
try:
with urlopen(Request(base + path, data, fields, method=method),
timeout=300) as response:
return json.load(response)
except HTTPError as error:
print(error.read().decode("utf-8", errors="replace"), file=sys.stderr)
if error.headers.get("Retry-After"):
print("Retry-After:", error.headers["Retry-After"], file=sys.stderr)
sys.exit("Check the original request ID before continuing.")
except (URLError, TimeoutError):
sys.exit("Connection interrupted. Check the original request ID.")
metadata = json.dumps({
"filename": video.name, "size_bytes": len(data),
"sha256": hashlib.sha256(data).hexdigest(), "language": "en",
}).encode()
session = request("/upload-session", "POST", metadata, "application/json")
if session.get("upload"):
import subprocess
upload = session["upload"]
if not upload["url"].startswith("https://"):
sys.exit("Expected an HTTPS object storage URL.")
fields = [arg for key, value in upload["fields"].items()
for arg in ("--form-string", f"{key}={value}")]
subprocess.run(["curl", "--fail", "--silent", "--show-error",
"--max-time", "120", *fields,
"--form", f"file=@{video}", upload["url"]], check=True)
complete = json.dumps({"generation": upload["generation"]}).encode()
request("/upload-complete", "POST", complete, "application/json")
job = request("")
active = {"uploading", "processing", "translation_pending"}
retryable = {"annotation_recognition_retry", "annotation_translation_retry"}
# Upload confirmation alone does not start annotation. Submit once even when
# an unsubmitted job already advertises automatic processing.
if job["status"] in active and not job.get("worker_active"):
if not job.get("error_code") or job["error_code"] in retryable:
job = request("/process", "POST")
while job["status"] in active:
if job.get("processing_mode") == "automatic" or job.get("worker_active"):
time.sleep(5)
job = request("")
elif not job.get("error_code") or job["error_code"] in retryable:
job = request("/process", "POST")
if job["status"] in active:
time.sleep(1)
else:
break
if job["status"] == "completed" and job.get("result_paged"):
result = job["result"]
result["segments"] = []
offset = 0
while offset is not None:
page = request(f"/result?offset={offset}")
result["segments"].extend(page["segments"])
if offset == 0:
result["hands"] = page["hands"]
else:
result["hands"]["segments"].extend(page["hands"]["segments"])
result["hands"]["audit"].extend(page["hands"]["audit"])
next_offset = page["next_offset"]
if next_offset is not None and next_offset <= offset:
sys.exit("Invalid result cursor. Check the saved job ID.")
offset = next_offset
job["result_paged"] = False
print(json.dumps(job, ensure_ascii=False, indent=2))
if job["status"] != "completed":
sys.exit(1)
PY