annotation dump#

Description#

annofabcli annotation restore コマンドに読み込ませることができるアノテーション情報を出力します。 アノテーションのバックアップ目的で利用することを想定しています。

Examples#

基本的な使い方#

--task_id に出力対象のタスクのtask_idを指定して、 --output_dir に出力先ディレクトリのパスを指定してください。

$ annofabcli annotation dump --project_id prj1 --task_id file://task.txt --output_dir backup-dir/

出力先ディレクトリの構成は以下の通りです。 {input_data_id}.json のフォーマットは、https://annofab.com/docs/api/#operation/getEditorAnnotation APIのレスポンス AnnotationV1 と同じです。

ルートディレクトリ/
├── {task_id}/
│   ├── {input_data_id}.json
│   ├── {input_data_id}/
│          ├── {annotation_id}............ 塗りつぶしPNG画像

アノテーション情報のリストアは、 annofabcli annotation restore コマンドで実現できます。

$ annofabcli annotation restore --project_id prj1 --annotation backup-dir/

警告

annotation dump コマンドの出力結果は、annotation restore コマンドに読み込ませることを目的として作られています。

annotation dump コマンドの出力結果であるJSONの構造は、現在V1形式ですが今後V2形式へ移行する予定です。 V1形式のJSON構造に依存したプログラムは、V2形式へ移行した際に動くなる可能性があります。 annotation dump コマンドの出力結果であるJSONの構造に直接依存したプログラムを作成する場合は、ご注意ください。

Usage Details#

`annotation restore`コマンドに読み込ませることができるアノテーション情報を出力します。アノテーションのバックアップ目的で利用することを想定しています。

usage: annofabcli annotation dump [-h] [--yes] [--endpoint_url ENDPOINT_URL]
                                  [--annofab_user_id ANNOFAB_USER_ID]
                                  [--annofab_password ANNOFAB_PASSWORD]
                                  [--mfa_code MFA_CODE] [--logdir LOGDIR]
                                  [--disable_log] [--debug] -p PROJECT_ID -t
                                  TASK_ID [TASK_ID ...] -o OUTPUT_DIR
                                  [--parallelism PARALLELISM]

Named Arguments#

-p, --project_id

対象のプロジェクトのproject_idを指定します。

-t, --task_id

対象のタスクのtask_idを指定します。 file:// を先頭に付けると、task_idの一覧が記載されたファイルを指定できます。

-o, --output_dir

出力先ディレクトリのパス

--parallelism

並列度。指定しない場合は、逐次的に処理します。

global optional arguments#

--yes

処理中に現れる問い合わせに対して、常に yes と回答します。

--endpoint_url

Annofab WebAPIのエンドポイントを指定します。

Default: "https://annofab.com"

--annofab_user_id

Annofabにログインする際のユーザーID

--annofab_password

Annofabにログインする際のパスワード

--mfa_code

Annofabにログインする際のMFAコード

--logdir

ログファイルを保存するディレクトリを指定します。

Default: .log

--disable_log

ログを無効にします。

--debug

HTTPリクエストの内容やレスポンスのステータスコードなど、デバッグ用のログが出力されます。

See also#