statistics visualize_annotation_duration#

Description#

ラベルごとまたは属性値ごとに、区間アノテーションの長さをヒストグラムで可視化したファイルを出力します。

Examples#

$ annofabcli statistics visualize_annotation_duration --project_id prj1 --output_dir out_dir/
out_dir/
├── annotation_duration_by_label.html                ラベルごとの区間アノテーションの長さをヒストグラムで可視化したHTMLファイル
├── annotation_duration_by_attribute.html            属性ごとの区間アノテーションの長さをヒストグラムで可視化したHTMLファイル
│

下図は annotation_duration_by_label.html の中身です。ラベル名ごとにヒストグラムが描画されています。

annotation_duration_by_label.htmlの中身

下図は annotation_duration_by_attribute.html の中身です。ラベル名、属性名、属性値のペアごとにヒストグラムが描画されています。

annotation_duration_by_attribute.htmlの中身

集計対象の属性の種類は以下の通りです。

  • ドロップダウン

  • ラジオボタン

  • チェックボックス

デフォルトでは、動画の長さは「秒」単位で表示されます。「分」単位で表示する場合は、 --time_unit minute を指定してください。

$ annofabcli statistics visualize_annotation_duration --project_id prj1 --output_dir out_dir2/ \
--time_unit minute
out_dir2/annotation_duration_by_label.htmlの中身

--bin_width を指定するとビンの幅を「秒」単位で指定できます。以下のコマンドはビンの幅を15秒(0.25分)に指定しています。

$ annofabcli statistics visualize_annotation_duration --project_id prj1 --output_dir out_dir3/ \
--time_unit minute --bin_width 15
out_dir3/annotation_duration_by_label.htmlの中身

デフォルトでは、各ヒストグラムのデータの範囲やビンの幅は異なります。すべてのヒストグラムでデータの範囲とビンの幅を揃える場合は、 --arrange_bin_edge を指定します。

$ annofabcli statistics visualize_annotation_duration --project_id prj1 --output_dir out_dir4/ \
--arrange_bin_edge
out_dir4/annotation_duration_by_label.htmlの中身

Usage Details#

ラベルごとまたは属性値ごとに区間アノテーションの長さをヒストグラムで可視化したファイルを出力します。

usage: annofabcli statistics visualize_annotation_duration [-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]
                                                           [-p PROJECT_ID] -o
                                                           OUTPUT_DIR
                                                           [--exclude_empty_value]
                                                           [--arrange_bin_edge]
                                                           [--bin_width BIN_WIDTH]
                                                           [--time_unit {second,minute}]
                                                           [-tq TASK_QUERY]
                                                           [-t TASK_ID [TASK_ID ...]]
                                                           [--latest]
                                                           [--temp_dir TEMP_DIR]

Named Arguments#

--annotation

アノテーションzip、またはzipを展開したディレクトリを指定します。指定しない場合はAnnofabからダウンロードします。

-p, --project_id

project_id。--annotation が未指定のときは必須です。--annotation が指定されているときに --project_id を指定すると、アノテーション仕様を参照して、集計対象の属性やグラフの順番が決まります。

-o, --output_dir

出力先ディレクトリのパス

--exclude_empty_value

指定すると、すべてのタスクで区間アノテーションの長さが0であるヒストグラムを描画しません。

--arrange_bin_edge

指定すると、ヒストグラムのデータの範囲とビンの幅がすべてのヒストグラムで一致します。

--bin_width

ヒストグラムのビンの幅を指定します。単位は「秒」です。指定しない場合は、ビンの個数が20になるようにビンの幅が調整されます。

--time_unit

Possible choices: second, minute

動画の長さの時間単位を指定します。

Default: "second"

-tq, --task_query

集計対象タスクを絞り込むためのクエリ条件をJSON形式で指定します。使用できるキーは task_id, status, phase, phase_stage です。 file:// を先頭に付けると、JSON形式のファイルを指定できます。

-t, --task_id

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

--latest

--annotation を指定しないとき、最新のアノテーションzipを参照します。このオプションを指定すると、アノテーションzipを更新するのに数分待ちます。

--temp_dir

指定したディレクトリに、アノテーションZIPなどの一時ファイルをダウンロードします。

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

オーナロールまたはアノテーションユーザロールを持つユーザで実行してください。