filesystem merge_annotation#

Description#

2つのアノテーションzip、またはそれを展開したディレクトリに存在するアノテーション情報をマージします。

Examples#

基本的な使い方#

--annotation には、Annofabからダウンロードしたアノテーションzip、またはアノテーションzipを展開したディレクトリを2つ指定してください。 アノテーションzipは、annofabcli annotation download コマンドでダウンロードできます。

$ annofabcli filesystem merge_annotation  \
--annotation annotation-A.zip annotation-B.zip \
--output_dir out/

アノテーションJSONは以下の通りマージされます。 annotation-A.zipannotation-B.zip の両方に同じannotation_idが存在する場合は、annotation-B.zip の情報を優先します。

annotation-A/task1/input1.json#
{
    // ...
    "details": [
        {
            "label": "car",
            "annotation_id": "anno1",
            // ...
        },
        {
            "label": "car",
            "annotation_id": "anno2",
            // ...
        }
    ]
}
annotation-B/task1/input1.json#
{
    // ...
    "details": [
        {
            "label": "car",
            "annotation_id": "anno2",
            // ...
        },
        {
            "label": "car",
            "annotation_id": "anno3",
            // ...
        }
    ]
}
out/task1/input1.json#
{
    // ...
    "details": [
        {
            "label": "car",
            "annotation_id": "anno1",
            // ...
        },
        {
            "label": "car",
            "annotation_id": "anno2",
            // annotaion-B 配下の情報
            // ...
        },
        {
            "label": "car",
            "annotation_id": "anno3",
            // ...
        }
    ]
}

タスクの絞り込み#

マージ対象のタスクを指定する場合は、--task_id に描画対象タスクのtask_idを指定してください。

$ annofabcli filesystem merge_annotation  \
--annotation annotation-A.zip annotation-B.zip \
--output_dir out/
--task_id task1 task2

Usage Details#

2つのアノテーションzip(またはzipを展開したディレクトリ)をマージします。具体的にはアノテーションjsonの'details'キー配下の情報をマージします。

usage: annofabcli filesystem merge_annotation [-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]
                                              --annotation ANNOTATION
                                              ANNOTATION -o OUTPUT_DIR
                                              [-t TASK_ID [TASK_ID ...]]

Named Arguments#

--annotation

Annofabからダウンロードしたアノテーションzip、またはzipを展開したディレクトリを2つ指定してください。

-o, --output_dir

出力先ディレクトリ

-t, --task_id

マージ対象であるタスクのtask_idを指定します。指定しない場合、すべてのタスクがマージ対象です。 file:// を先頭に付けると、task_idの一覧が記載されたファイルを指定できます。

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#