<jupyter_start><jupyter_text>概要アノテーションデータセットを確認する。<jupyter_code>%config Completer.use_jedi = False
from chainercv.chainer_experimental.datasets.sliceable import TupleDataset
from chainercv.visualizations import vis_bbox

from src.preprocessor import ChocoPreProcessor
from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
c_list = sns.color_palette().as_hex()
color_num = len(c_list)
%load_ext autoreload
%autoreload 2
IMG_DIR = "../data/res_images"
BBOX_DIR = "../data/res_images"
CLASSES_FILE = "../data/classes.txt"
choco_prep = ChocoPreProcessor()
choco_prep.set_classes(class_file=CLASSES_FILE)
_ = choco_prep.set_dataset(anno_dir=BBOX_DIR, img_dir=IMG_DIR)
bboxs = choco_prep.get_bbox_list()
imgs = choco_prep.get_img_array()
obj_ids = choco_prep.get_object_ids_list()
classes = choco_prep.get_object_classes()
dataset = TupleDataset(('img', imgs), ('bbox', bboxs), ('label', obj_ids))
def plot_labeled_data(idx=1):
    tmp_img, tmp_bboxs, tmp_labels = dataset[idx]
    vis_bbox(tmp_img, tmp_bboxs, tmp_labels, label_names=classes)
    plt.show()
interact(plot_labeled_data, idx=(0, len(dataset)))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10952380952380952, 'fraction_numerical': 0.002380952380952381, 'mean_word_length': 7.818181818181818, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '161483', 'license': 'MIT', 'n_tokens_mistral': 501, 'n_tokens_neox': 487, 'n_words': 85, 'path': 'notebook/check_annotated_dataset.ipynb', 'repo_name': 'tok41/ChocoBallDetectorTrainer', 'size': '1260'}