annotation list#

Description#

アノテーション一覧を出力します。

Examples#

基本的な使い方#

以下のコマンドは、すべてのアノテーションの一覧を出力します。 ただし10,000件までしか出力できません。

$ annofabcli annotation list --project_id prj1

警告

WebAPIの都合上、集計対象のアノテーションは10,000個までしか検索できません。

--annotation_query で、アノテーションを検索するする条件を指定することができます。 --annotation_query のサンプルは、Command line options を参照してください。

以下のコマンドは、ラベル名(英語)が"car"であるアノテーションの一覧を出力します。

$ annofabcli annotation list --project_id prj1 \
--annotation_query '{"label": "car"}'

--task_id で出力対象のタスクを絞り込むこともできます。

$ annofabcli annotation list --project_id prj1 \
--task_id file://task.txt

出力結果#

JSON出力#

$ annofabcli annotation list --format pretty_json --output out.json
out.json#
[
    {
        "project_id": "prj1",
        "task_id": "task1",
        "input_data_id": "input1",
        "detail": {
            "annotation_id": "annotation1",
            "account_id": "account1",
            "label_id": "label1",
            "data_holding_type": "inner",
            "data": {
                "left_top": {
                "x": 10,
                "y": 7
                },
                "right_bottom": {
                "x": 36,
                "y": 36
                },
                "_type": "BoundingBox"
            },
            "etag": null,
            "url": null,
            "additional_data_list": [],
            "created_datetime": "2019-08-22T12:04:19.256+09:00",
            "updated_datetime": "2019-08-22T14:12:45.555+09:00",
            "label_name_en": "car",
            "user_id": "user1",
            "username": "user1"
        },
        "updated_datetime": "2019-08-22T14:14:11.084+09:00"
    },

    ...
]

CSV出力#

$ annofabcli annotation list --format csv --output out.csv

out.csv

Usage Details#

アノテーションの一覧を出力します。

usage: annofabcli annotation list [-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
                                  [-aq ANNOTATION_QUERY]
                                  [-t TASK_ID [TASK_ID ...] | -i INPUT_DATA_ID
                                  [INPUT_DATA_ID ...]]
                                  [-f {csv,json,pretty_json}]
                                  [--csv_format CSV_FORMAT] [-o OUTPUT]

Named Arguments#

-p, --project_id

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

-aq, --annotation_query

アノテーションの検索クエリをJSON形式で指定します。 file:// を先頭に付けると、JSON形式のファイルを指定できます。

-t, --task_id

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

-i, --input_data_id

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

-f, --format

Possible choices: csv, json, pretty_json

出力フォーマットを指定します。

Default: "csv"

--csv_format

CSVのフォーマットをJSON形式で指定します。 --formatcsv でないときは、このオプションは無視されます。 file:// を先頭に付けると、JSON形式のファイルを指定できます。 指定した値は pandas.DataFrame.to_csv の引数として渡されます。

-o, --output

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

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