annotation list#

Description#

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

Examples#

基本的な使い方#

以下のコマンドは、すべてのアノテーションの一覧を出力します。

$ annofabcli annotation list --project_id prj1

警告

WebAPIの都合上、1回のWebAPI( getAnnotationList API)のアクセスで取得できるアノテーションは最大10,000件です。 したがって、 --task_id または --input_data_id を指定しない場合は、10,000件までしかアノテーション情報は出力されません。 --task_id または --input_data_id を指定した場合は、task_idまたはinput_data_idごとに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": "anno1",
    "account_id": "account1",
    "label_id": "label1",
    "body": {
        "data": {
        "points": [
            {
            "x": 663,
            "y": 376
            },
            {
            "x": 664,
            "y": 432
            },
        ],
        "_type": "Points"
        },
        "_type": "Inner"
    },
    "additional_data_list": [],
    "created_datetime": "2024-07-11T15:27:29.436+09:00",
    "updated_datetime": "2024-07-11T15:27:29.436+09:00",
    "label_name_en": "human",
    "user_id": "alice",
    "username": "ALICE"
    },
    "updated_datetime": "2024-07-12T11:39:57.478+09:00"
},
...
]

CSV出力#

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

project_id

task_id

input_data_id

detail.annotation_id

detail.abel_id

detail.label_name_en

detail.data_holding_type

detail.created_datetime

detail.updated_datetime

detail.account_id

detail.user_id

detail.username

detail.data

prj1

task1

input1

annotation1

label1

car

inner

2019-08-22T12:04:19.256+09:00

2019-08-22T14:12:45.555+09:00

account1

user1

user1

{'data': {'points': [{'x': 663, 'y': 376}, {'x': 664, 'y': 432}], '_type': 'Points'}, '_type': 'Inner'}

Usage Details#

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

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

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