comment put_inspection#

Description#

検査コメントを付与します。

注釈

タスクが教師付けフェーズのときは、検査コメントを付与できません。検査コメントを付与するには、タスクのフェーズを「検査」または「受入」にする必要があります。

Examples#

基本的な使い方#

--json に検査コメントの内容をJSON形式で指定すると、検査コメントを付与できます。

comment.json#
{
    "task1":{
        "input_data1": [
            {
                "comment": "type属性が間違っています。",
                "data": {
                    "x":10,
                    "y":20,
                    "_type": "Point"
                }
            },
            {
                "comment": "枠がズレています。 #A1",
                "data": {
                    "coordinates":[
                        {"x":20, "y":20}, {"x":30, "y":30}
                    ],
                    "_type": "Polyline"
                },
                "annotation_id": "foo",
                "phrases": ["A1"]
            }
        ]
    }
}
  • 1階層目のキーはtask_id, 2階層目のキーはinput_data_idです。

  • 検査コメントのプロパティとして指定できるキーは以下の通りです。

    • comment:検査コメントの内容。必須。

    • data:検査コメントの位置や区間。 annotation_id が指定されていない場合は必須。 annotation_id が指定されている場合はオプショナル。省略した場合は、アノテーション情報から自動補完されます(サポートしているアノテーションタイプ: user_bounding_box, bounding_box, polygon, polyline, point, range)。 bounding_box は中心点に、 polygonpolyline は先頭の点に、 point はその点に、 range は区間に検査コメントが付与されます。それ以外のアノテーションタイプ(塗りつぶし、分類など)の場合、プロジェクトタイプに応じたデフォルト位置(画像プロジェクトなら(0,0)、動画プロジェクトなら0-100ミリ秒など)に検査コメントが付与されます。詳細は後述を参照してください。

    • annotation_id:検査コメントに紐づくアノテーションのannotation_id

    • phrases:参照する定型指摘のIDの配列

    • comment_id:コメントID。省略した場合は自動的にUUIDv4が生成されます。

$ annofabcli comment put_inspection --project_id prj1 --json file://comment.json

CSV形式で指定する場合#

--csv にCSVファイルを指定すると、検査コメントを付与できます。

comment.csv#
task_id,input_data_id,comment,data,annotation_id,phrases,comment_id
task001,input001,type属性が間違っています。,"{""x"":10,""y"":20,""_type"":""Point""}",,,
task001,input002,枠がズレています。,"{""x"":20,""y"":20,""_type"":""Point""}",anno123,"[""A1""]",
task002,input003,ラベルが不適切です。,,anno456,"[""ID1"",""ID2""]",
  • CSVには以下の列が必要です。

    • task_id (必須):タスクID

    • input_data_id (必須):入力データID

    • comment (必須):コメント本文

    • data (任意):コメント位置情報(JSON形式の文字列)

    • annotation_id (任意):紐付けるアノテーションID

    • phrases (任意):定型指摘IDのリスト(JSON配列形式の文字列。例: '["ID1","ID2"]'

    • comment_id (任意):コメントID(省略時はUUIDv4自動生成)

$ annofabcli comment put_inspection --project_id prj1 --csv comment.csv

data プロパティに渡す値の例#

画像プロジェクト:(x=0,y=0)の位置に点#
{
    "x":0,
    "y":0,
    "_type": "Point"
}
画像プロジェクト:(x=0,y=0),(x=100,y=100)のポリライン#
{
    "coordinates": [{"x":0, "y":0}, {"x":100, "y":100}],
    "_type": "Polyline"
}
動画プロジェクト:0〜100ミリ秒の区間#
{
    "start":0,
    "end":100,
    "_type": "Time"
}
カスタムプロジェクト(3dpc editor):原点付近に辺が1の立方体#
{
    "data": "{\"kind\": \"CUBOID\", \"shape\": {\"dimensions\": {\"width\": 1.0, \"height\": 1.0, \"depth\": 1.0}, \"location\": {\"x\": 0.0, \"y\": 0.0, \"z\": 0.0}, \"rotation\": {\"x\": 0.0, \"y\": 0.0, \"z\": 0.0}, \"direction\": {\"front\": {\"x\": 1.0, \"y\": 0.0, \"z\": 0.0}, \"up\": {\"x\": 0.0, \"y\": 0.0, \"z\": 1.0}}}, \"version\": \"2\"}",
    "_type": "Custom"
}

並列処理#

以下のコマンドは、並列数4で実行します。

$  annofabcli comment put_inspection --project_id prj1 --json file://comment.json \
--parallelism 4 --yes

Usage Details#

検査コメントを付与します。

usage: annofabcli comment put_inspection [-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
                                         (--json JSON | --csv CSV)
                                         [--parallelism {2,3,4}]

Named Arguments#

-p, --project_id

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

--json

付与する検査コメントの内容をJSON形式で指定してください。file:// を先頭に付けると、JSON形式のファイルを指定できます。

各コメントには comment_id を指定することができます。省略した場合は自動的にUUIDv4が生成されます。

(ex) {"task1": {"input_data1": [{"comment": "type属性が間違っています。", "data": {"x": 10, "y": 20, "_type": "Point"}}]}}

--csv

付与する検査コメントの内容をCSV形式で指定してください。 CSVには以下の列が必要です:

  • task_id (必須): タスクID

  • input_data_id (必須): 入力データID

  • comment (必須): コメント本文

  • data (任意): コメント位置情報(JSON形式の文字列。例: ``'{"x":10,"y":20,"_type":"Point"}' `` )

  • annotation_id (任意): 紐付けるアノテーションID

  • phrases (任意): 定型指摘IDのリスト(JSON配列形式の文字列。例: ``'["ID1","ID2"]' `` )

  • comment_id (任意): コメントID(省略時はUUIDv4自動生成)

--parallelism

Possible choices: 2, 3, 4

使用するプロセス数(並列度)を指定してください。指定する場合は必ず --yes を指定してください。指定しない場合は、逐次的に処理します。

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

チェッカーロールまたはオーナロールを持つユーザで実行してください。