annotation_zip list_range_annotation#
Description#
アノテーションZIPから動画プロジェクトの区間アノテーションの情報を出力します。
動画プロジェクト以外のプロジェクトでは実行できません。
Examples#
基本的な使用例#
$ annofabcli annotation_zip list_range_annotation --project_id prj1 --output out.csv --format csv
$ annofabcli annotation_zip list_range_annotation --annotation annotation.zip --output out.json --format pretty_json
出力結果の例(JSON形式)#
[
{
"project_id": "proj1",
"task_id": "task_00",
"task_phase": "annotation",
"task_phase_stage": 1,
"task_status": "complete",
"input_data_id": "input1",
"input_data_name": "video1.mp4",
"updated_datetime": "2023-10-01T12:00:00.000+09:00",
"label": "音声",
"annotation_id": "ann1",
"annotation_editor_url": "https://annofab.com/projects/proj1/tasks/task_00/timeline?#ann1/10.5",
"begin_second": 10.5,
"end_second": 15.8,
"duration_second": 5.3,
"attributes": {
"speaker": "male",
"language": "ja"
}
}
]
出力結果の例(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 |
begin_second |
end_second |
duration_second |
attributes.speaker |
attributes.language |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
proj1 |
task_00 |
annotation |
1 |
complete |
input1 |
video1.mp4 |
2023-10-01T12:00:00.000+09:00 |
音声 |
ann1 |
https://annofab.com/projects/proj1/tasks/task_00/timeline?#ann1/10.5 |
10.5 |
15.8 |
5.3 |
male |
ja |
出力項目#
CSV形式およびJSON形式で以下の項目が出力されます:
project_id: プロジェクトIDtask_id: タスクIDtask_phase: タスクフェーズtask_phase_stage: タスクフェーズの段階task_status: タスクステータスinput_data_id: 入力データIDinput_data_name: 入力データ名updated_datetime: アノテーションJSONの更新日時label: アノテーションのラベルannotation_id: アノテーションIDannotation_editor_url: アノテーションエディタのURL。対象のアノテーションを直接開くことができます。begin_second: 区間の開始時刻(秒)end_second: 区間の終了時刻(秒)duration_second: 区間の長さ(秒)attributes: アノテーションの属性情報(JSON形式)attributes.{属性名}: 各属性の値(CSV形式)
Usage Details#
アノテーションZIPから動画プロジェクトの区間アノテーションの情報を出力します。
usage: annofabcli annotation_zip list_range_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 ...]]
[--latest]
[--temp_dir TEMP_DIR]
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の一覧が記載されたファイルを指定できます。- --label_name
指定したラベル名の区間アノテーションのみを対象にします。複数指定できます。
- --latest
--annotationを指定しないとき、最新のアノテーションzipを参照します。このオプションを指定すると、アノテーションzipを更新するのに数分待ちます。- --temp_dir
指定したディレクトリに、アノテーションZIPなどの一時ファイルをダウンロードします。
global optional arguments#
- --yes
処理中に現れる問い合わせに対して、常に
yesと回答します。- --endpoint_url
Annofab WebAPIのエンドポイントを指定します。
Default:
'https://annofab.com'- --annofab_user_id
Annofabにログインする際のユーザーID
- --annofab_password
Annofabにログインする際のパスワード
- --annofab_pat
Annofabにログインする際のパーソナルアクセストークン
- --logdir
ログファイルを保存するディレクトリを指定します。
Default:
.log- --disable_log
ログを無効にします。
- --debug
HTTPリクエストの内容やレスポンスのステータスコードなど、デバッグ用のログが出力されます。
アノテーションZIPをダウンロードする場合は、オーナロールまたはアノテーションユーザロールを持つユーザで実行してください。