optical.converter.Annotation

class optical.converter.Annotation(root: str, format: str)[source]

Bases: object

__init__(root: str, format: str)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(root, format)

Initialize self.

bbox_scatter([split, category])

bbox_stats([split, category])

describe()

export(to[, output_dir])

show_distribution()

train_test_split([test_size, stratified, …])

splits the dataset into train and validation sets

visualizer([image_dir, split, img_size])

Attributes

label_df

splits

train_test_split(test_size: float = 0.2, stratified: bool = False, random_state: int = 42)[source]

splits the dataset into train and validation sets

Parameters
  • test_size (float, optional) – Fraction of total images to be kept for validation. Defaults to 0.2.

  • stratified (bool, optional) – Whether to stratify the split. Defaults to False.

  • random_state (int, optional) – random state for the split. Defaults to 42.

Returns

Returns an instance of FormatSpec class

Return type

FormatSpec