annotation_specs add_labels#

Description#

アノテーション仕様にラベルを複数件追加します。

Examples#

ラベル名(英語)を複数指定する場合#

$ annofabcli annotation_specs add_labels \
 --project_id prj1 \
 --label_name_en pedestrian bicycle traffic_light \
 --annotation_type bounding_box

JSON形式で指定する場合#

labels.json#
[
    {
        "label_name_en": "pedestrian",
        "annotation_type": "bounding_box",
        "color": "#123456"
    },
    {
        "label_id": "bicycle",
        "label_name_en": "bicycle",
        "label_name_ja": "自転車",
        "annotation_type": "bounding_box",
        "color": "#00AAFF"
    }
]
$ annofabcli annotation_specs add_labels \
 --project_id prj1 \
 --label_json file://labels.json

CSV形式で指定する場合#

labels.csv#
label_id,label_name_en,label_name_ja,annotation_type,color,field_values
,pedestrian,,segmentation_v2,#123456,
bicycle,bicycle,自転車,segmentation_v2,#00AAFF,
$ annofabcli annotation_specs add_labels \
 --project_id prj1 \
 --label_csv labels.csv

注釈

--annotation_type の値は、annotation_specs add_label を参照してください。 --label_name_en を使う場合は --annotation_type が必須です。 --label_json / --label_csv を使う場合は、各ラベルに annotation_type を指定できます。 --annotation_type を併用した場合は、省略時の既定値として使われます。 ラベル側の annotation_type--annotation_type が不一致の場合はエラーになります。

Usage Details#

アノテーション仕様にラベルを複数件追加します。

usage: annofabcli annotation_specs add_labels [-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
                                              (--label_name_en LABEL_NAME_EN [LABEL_NAME_EN ...] | --label_json LABEL_JSON | --label_csv LABEL_CSV)
                                              [--annotation_type {bounding_box,segmentation,segmentation_v2,polygon,polyline,point,classification,range,custom,user_bounding_box,user_instance_segment,user_semantic_segment}]
                                              [--comment COMMENT]

Named Arguments#

-p, --project_id

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

--label_name_en

追加するラベルの英語名。複数指定できます。 file:// を先頭に付けると一覧ファイルを指定できます。

--label_json

追加するラベル情報のJSON配列を指定します。 file:// を先頭に付けるとJSON形式のファイルを指定できます。 各要素には label_name_en が必要です。 任意で label_id , label_name_ja , annotation_type , color , field_values を指定できます。 (例) [{"label_id": "pedestrian", "label_name_en": "pedestrian", "label_name_ja": "歩行者", "annotation_type": "bounding_box", "color": "#123456"}, {"label_name_en": "bicycle", "annotation_type": "bounding_box"}]

--label_csv

追加するラベル情報のCSVファイルを指定します。 CSVには label_name_en 列が必要です。 任意で label_id , label_name_ja , annotation_type , color , field_values 列を指定できます。

--annotation_type

Possible choices: bounding_box, segmentation, segmentation_v2, polygon, polyline, point, classification, range, custom, user_bounding_box, user_instance_segment, user_semantic_segment

追加するラベルの既定のアノテーション種類。 --label_name_en を指定する場合は必須です。 JSON/CSV側にも annotation_type を指定できます。 追加するラベルのアノテーション種類。

指定できる値:
  • bounding_box : 矩形 [画像プロジェクト で使用可]

  • segmentation : 塗りつぶし(インスタンスセグメンテーション用) [画像プロジェクト で使用可]

  • segmentation_v2 : 塗りつぶしv2(セマンティックセグメンテーション用) [画像プロジェクト で使用可]

  • polygon : ポリゴン(閉じた頂点集合) [画像プロジェクト で使用可]

  • polyline : ポリライン(開いた頂点集合) [画像プロジェクト で使用可]

  • point : 点 [画像プロジェクト で使用可]

  • classification : 全体分類 [画像プロジェクト / 動画プロジェクト で使用可]

  • range : 動画の区間 [動画プロジェクト で使用可]

  • custom : カスタム [カスタムプロジェクト で使用可]

  • user_bounding_box : 3次元のバウンディングボックス [3次元プロジェクト で使用可]

  • user_instance_segment : 3次元のインスタンスセグメント [3次元プロジェクト で使用可]

  • user_semantic_segment : 3次元のセマンティックセグメント [3次元プロジェクト で使用可]

--comment

アノテーション仕様の変更内容を説明するコメント。未指定の場合、自動でコメントが生成されます。

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