annotation_zip list_3d_bounding_box_annotation#
Description#
アノテーションZIPから3Dバウンディングボックス(CUBOID)アノテーションの座標情報を出力します。
Examples#
出力例(CSV形式)#
$ annofabcli annotation_zip list_3d_bounding_box_annotation --project_id prj1 --format csv --output out.csv
project_id |
task_id |
task_phase |
task_phase_stage |
task_status |
input_data_id |
input_data_name |
updated_datetime |
label |
annotation_id |
annotation_editor_url |
dimensions.width |
dimensions.height |
dimensions.depth |
location.x |
location.y |
location.z |
rotation.x |
rotation.y |
rotation.z |
volume |
footprint_area |
bottom_z |
top_z |
horizontal_distance |
attributes.occluded |
attributes.type |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
prj1 |
task_00 |
annotation |
1 |
complete |
i1 |
i1.bin |
2023-10-01T12:00:00.000+09:00 |
car |
ann1 |
https://d2rljy8mjgrfyd.cloudfront.net/3d-editor-latest/index.html?p=prj1&t=task_00/#i1/ann1 |
2.39 |
1.56 |
5.16 |
-0.32 |
13.09 |
0.71 |
0.0 |
0.0 |
4.71 |
19.238544 |
12.332400000000002 |
-0.07000000000000006 |
1.49 |
13.093910798535326 |
True |
sedan |
出力例(JSON形式)#
$ annofabcli annotation_zip list_3d_bounding_box_annotation --project_id prj1 --output out.json --format pretty_json
[
{
"project_id": "prj1",
"task_id": "task_00",
"task_status": "complete",
"task_phase": "annotation",
"task_phase_stage": 1,
"input_data_id": "i1",
"input_data_name": "i1.bin",
"updated_datetime": "2023-10-01T12:00:00.000+09:00",
"label": "car",
"annotation_id": "ann1",
"annotation_editor_url": "https://d2rljy8mjgrfyd.cloudfront.net/3d-editor-latest/index.html?p=prj1&t=task_00/#i1/ann1",
"dimensions": {
"width": 2.39,
"height": 1.56,
"depth": 5.16
},
"location": {
"x": -0.32,
"y": 13.09,
"z": 0.71
},
"rotation": {
"x": 0,
"y": 0,
"z": 4.71
},
"direction": {
"front": {
"x": 0,
"y": -1,
"z": 0
},
"up": {
"x": 0,
"y": 0,
"z": 1
}
},
"volume": 19.238544,
"footprint_area": 12.332400000000002,
"bottom_z": -0.07000000000000006,
"top_z": 1.49,
"horizontal_distance": 13.093910798535326,
"attributes": {
"occluded": true,
"type": "sedan"
}
}
]
特定のラベルのみを出力#
$ annofabcli annotation_zip list_3d_bounding_box_annotation --project_id prj1 \
--label_name car truck --output out.csv
アノテーションZIPを直接指定#
$ annofabcli annotation_zip list_3d_bounding_box_annotation --annotation annotation.zip --output out.csv
出力項目について#
CSVまたはJSON形式で以下の項目が出力されます。
基本情報#
project_id: プロジェクトID
task_id: タスクID
task_status: タスクステータス
task_phase: タスクフェーズ
task_phase_stage: タスクフェーズステージ
input_data_id: 入力データID
input_data_name: 入力データ名
updated_datetime: アノテーションJSONの更新日時
label: ラベル名
annotation_id: アノテーションID
annotation_editor_url: アノテーションエディタのURL。対象のアノテーションを直接開くことができます。
3Dバウンディングボックス情報#
アノテーションJSONと同様の形式で出力されます。
dimensions: サイズ情報(width, height, depth)
location: 中心座標(x, y, z)
rotation: 回転情報(x=roll, y=pitch, z=yaw)
direction: 方向ベクトル(front, up)。CSV形式では出力されません
追加情報#
アノテーションJSONに含まれていない以下の項目も出力されます。
volume: 体積(width × height × depth)
footprint_area: 底面積(width × depth)。地面占有面積。
bottom_z: 底面のZ座標(location.z - height/2)。回転は考慮していない。
top_z: 天面のZ座標(location.z + height/2)。回転は考慮していない。
horizontal_distance: 原点(0, 0)からのXY平面上の距離(sqrt(location.x² + location.y²))
属性情報#
attributes: 属性情報。JSON形式ではオブジェクト、CSV形式では
attributes.属性名の形式で列が追加されます。
タスクメタデータを出力する#
--with_task_metadata を指定すると、タスクのメタデータをすべて出力します。
CSVでは task_id の直後に、対象タスクのいずれかに存在するキーを task_metadata.<key> 形式の列として出力します。キーがタスクに存在しない場合、そのセルは空になります。
JSONでは、タスクのメタデータ全体を task_metadata オブジェクトに出力します。
Usage Details#
アノテーションZIPから3Dバウンディングボックス(CUBOID)アノテーションの座標情報を出力します。
usage: annofabcli annotation_zip list_3d_bounding_box_annotation
[-h] [--yes] [--endpoint_url ENDPOINT_URL]
[--annofab_user_id ANNOFAB_USER_ID]
[--annofab_password ANNOFAB_PASSWORD] [--annofab_pat ANNOFAB_PAT]
[--logdir LOGDIR] [--disable_log] [--debug] (--annotation ANNOTATION |
-p PROJECT_ID) [-f {csv,json,pretty_json}] [-o OUTPUT] [-tq TASK_QUERY]
[-t TASK_ID [TASK_ID ...]] [--label_name LABEL_NAME [LABEL_NAME ...]]
[--with_task_metadata] [--latest] [--temp_dir TEMP_DIR]
[--use_japanese_name]
Named Arguments#
- --annotation
アノテーションzip、またはzipを展開したディレクトリを指定します。
- -p, --project_id
project_id。アノテーションZIPをダウンロードします。
- -f, --format
Possible choices: csv, json, pretty_json
出力フォーマットを指定します。
Default:
'csv'- -o, --output
出力先のファイルパスを指定します。未指定の場合は、標準出力に出力されます。
- -tq, --task_query
集計対象タスクを絞り込むためのクエリ条件をJSON形式で指定します。使用できるキーは task_id, status, phase, phase_stage です。
file://を先頭に付けると、JSON形式のファイルを指定できます。- -t, --task_id
対象のタスクのtask_idを指定します。
file://を先頭に付けると、task_idの一覧が記載されたファイルを指定できます。ファイルを読み込む場合は、ファイル指定を1個だけ渡してください。直接指定するIDや別のファイル指定とは併用できません。- --label_name
指定したラベル名の3Dバウンディングボックスアノテーションのみを対象にします。複数指定できます。
file://を先頭に付けると、改行区切りの一覧ファイルを指定できます。 ファイルを読み込む場合は、ファイル指定を1個だけ渡してください。直接指定する値や別のファイル指定とは併用できません。- --with_task_metadata
タスクメタデータを出力します。CSVでは
task_metadata.<key>列、JSONではtask_metadataキーに出力します。- --latest
--annotationを指定しないとき、最新のアノテーションzipを参照します。このオプションを指定すると、アノテーションzipを更新するのに数分待ちます。- --temp_dir
指定したディレクトリに、アノテーションZIPなどの一時ファイルをダウンロードします。
- --use_japanese_name
ラベル名、属性名、選択肢名をアノテーション仕様に登録されている日本語名で出力します。日本語名がない場合は英語名を出力します。
common options (after the subcommand)#
- --yes
処理中に現れる問い合わせに対して、常に
yesと回答します。- --endpoint_url
Annofab WebAPIのエンドポイントを指定します。
- --annofab_user_id
Annofabにログインする際のユーザーID
- --annofab_password
Annofabにログインする際のパスワード
- --annofab_pat
Annofabにログインする際のパーソナルアクセストークン
- --logdir
ログファイルを保存するディレクトリを指定します。
Default:
.log- --disable_log
ログを無効にします。
- --debug
HTTPリクエストの内容やレスポンスのステータスコードなど、デバッグ用のログが出力されます。
アノテーションZIPをダウンロードする場合は、オーナロールまたはアノテーションユーザロールを持つユーザで実行してください。