-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
statistics visualize_annotation_duration
: 引数--bin_width
, `--tim…
…e_unit`を追加 (#1190) * 引数追加 * 可視化 * ラベルごとのヒストグラムの感さえい * 属性のヒストグラムを修正 * タイトルを表示 * metadataの表示 * format * 可視化 * udpate pylintrc * update docs
- Loading branch information
1 parent
8711957
commit 49072b5
Showing
9 changed files
with
524 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from __future__ import annotations | ||
|
||
import json | ||
import math | ||
from typing import Any, Optional | ||
|
||
from bokeh.models import LayoutDOM | ||
from bokeh.models.widgets.markups import PreText | ||
from bokeh.plotting import figure | ||
|
||
|
||
def create_pretext_from_metadata(metadata: dict[str, Any]) -> PreText: | ||
text_lines = [f"{key} = {json.dumps(value)}" for key, value in metadata.items()] | ||
text = "\n".join(text_lines) | ||
return PreText(text=text) | ||
|
||
|
||
def convert_1d_figure_list_to_2d(figure_list: list[figure], *, ncols: int = 4) -> list[list[Optional[LayoutDOM]]]: | ||
""" | ||
1次元のfigure_listを、grid layout用に2次元のfigureリストに変換する。 | ||
""" | ||
row_list: list[list[Optional[LayoutDOM]]] = [] | ||
|
||
for i in range(math.ceil(len(figure_list) / ncols)): | ||
start = i * ncols | ||
end = (i + 1) * ncols | ||
row: list[Optional[LayoutDOM]] = [] | ||
row.extend(figure_list[start:end]) | ||
if len(row) < ncols: | ||
row.extend([None] * (ncols - len(row))) | ||
row_list.append(row) | ||
|
||
return row_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.