annotation_specs list_label#

Description#

アノテーション仕様のラベル情報を出力します。

Examples#

基本的な使い方#

$ annofabcli annotation_specs list_label --project_id prj1

デフォルトでは最新のアノテーション仕様を出力します。過去のアノテーション仕様を出力する場合は、--before または --history_id を指定してください。 history_idは、annofabcli annotation_specs list_history コマンドで取得できます。

以下のコマンドは、最新より1つ前のアノテーション仕様を出力します。

$ annofabcli annotation_specs list_label --project_id prj1 --before 1

以下のコマンドは、history_idが"xxx"のアノテーション仕様を出力します。

$ annofabcli annotation_specs list_label --project_id prj1 --history_id xxx

出力結果#

JSON出力#

$ annofabcli annotation_specs list_label --project_id prj1  --format pretty_json --output out.json
out.json#
[
    {
        "label_id": "dc14bd37-c31e-4ca1-99f3-4025edae5bb9",
        "label_name_en": "car",
        "label_name_ja": "car",
        "label_name_vi": "car",
        "annotation_type": "bounding_box",
        "color": "#8100D8",
        "attribute_count": 5,
        "keybind": "Ctrl+Digit1"
    }
]
  • label_id : ラベルID

  • label_name_en : ラベル名(英語)

  • label_name_ja : ラベル名(日本語)

  • label_name_vi : ラベル名(ベトナム語)

  • annotation_type : アノテーションの種類。Web APIの AnnotationType に対応しています。

  • color : ラベルの色(HEX形式)。

  • attribute_count : ラベルに紐づく属性の個数

  • keybind : キーボードショートカット

Usage Details#

アノテーション仕様のラベル情報を出力します。

usage: annofabcli annotation_specs list_label [-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]
                                              (-p PROJECT_ID | --annotation_specs_json ANNOTATION_SPECS_JSON)
                                              [--history_id HISTORY_ID | --before BEFORE]
                                              [-f {csv,json,pretty_json}]
                                              [-o OUTPUT]

Named Arguments#

-p, --project_id

対象のプロジェクトのproject_idを指定します。APIで取得したアノテーション仕様情報を元に出力します。

--annotation_specs_json

指定したアノテーション仕様のJSONファイルを指定します。JSONファイルに記載された情報を元に出力します。ただしアノテーション仕様の format_version3 である必要があります。

--history_id

出力したいアノテーション仕様のhistory_idを指定してください。 history_idは annotation_specs list_history コマンドで確認できます。 指定しない場合は、最新のアノテーション仕様が出力されます。

--before

出力したい過去のアノテーション仕様が、最新よりいくつ前のアノテーション仕様であるかを指定してください。 たとえば 1 を指定した場合、最新より1個前のアノテーション仕様を出力します。 指定しない場合は、最新のアノテーション仕様が出力されます。

-f, --format

Possible choices: csv, json, pretty_json

出力フォーマット

Default: 'csv'

-o, --output

出力先のファイルパスを指定します。未指定の場合は、標準出力に出力されます。

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リクエストの内容やレスポンスのステータスコードなど、デバッグ用のログが出力されます。