8.1.1.3.1.1. blueoil.datasets.base

8.1.1.3.1.1.1. Module Contents

8.1.1.3.1.1.1.1. Classes

Base

Dataset base class

SegmentationBase

Dataset base class

ObjectDetectionBase

Dataset base class

KeypointDetectionBase

Dataset base class

DistributionInterface

StoragePathCustomizable

Make it possible to specify train, validation path.

class blueoil.datasets.base.Base(subset='train', batch_size=10, augmentor=None, pre_processor=None, data_format='NHWC', seed=None, **kwargs)

Dataset base class

available_subsets = ['train', 'validation']
property data_dir(self)
property classes

Return the classes list in the data set.

property num_classes

Return the number of classes in the data set.

property extend_dir

Return the extend dir path of the data set.

property num_per_epoch(self)

Returns the number of datas in the data subset.

property __getitem__(self, i)

Returns the i-th item of the dataset.

property __len__(self)

returns the number of items in the dataset.

class blueoil.datasets.base.SegmentationBase(*args, label_colors=None, **kwargs)

Bases: blueoil.datasets.base.Base

Dataset base class

property label_colors(self)
class blueoil.datasets.base.ObjectDetectionBase(subset='train', batch_size=10, augmentor=None, pre_processor=None, data_format='NHWC', seed=None, **kwargs)

Bases: blueoil.datasets.base.Base

Dataset base class

abstract classmethod count_max_boxes(cls)

Count max boxes size over all subsets.

property num_max_boxes(self)

Return count max box size of available subsets.

_fill_dummy_boxes(self, gt_boxes)
_change_gt_boxes_shape(self, gt_boxes_list)

Change gt boxes list shape from [batch_size, num_boxes, 5] to [batch_size, num_max_boxes, 5].

fill dummy box when num boxes < num max boxes.

Parameters

gt_boxes_list – python list of gt_boxes(np.ndarray). gt_boxes’s shape is [batch_size, num_boxes, 5]

Returns

numpy ndarray [batch_size, num_max_boxes, 5].

Return type

gt_boxes_list

class blueoil.datasets.base.KeypointDetectionBase(subset='train', batch_size=10, augmentor=None, pre_processor=None, data_format='NHWC', seed=None, **kwargs)

Bases: blueoil.datasets.base.Base

Dataset base class

static crop_from_full_image(full_image, box, joints)

Crop one example used for single-person pose estimation from a full sized image. :param full_image: a numpy array of shape (full_height, full_width, 3). :param box: a list, [x1, y1, x2, y2]. :param joints: a numpy array of shape (num_joints, 3). It has global offset.

Returns

a numpy array cropped from full_image. It’s shape depends on box. new_joints: a numpy array of shape (num_joints, 3). It has local offset.

Return type

cropped_image

class blueoil.datasets.base.DistributionInterface
abstract update_dataset(self, indices)

Update own dataset by indices.

abstract get_shuffle_index(self)

Return list of shuffled index.

class blueoil.datasets.base.StoragePathCustomizable(validation_size=0.1, *args, **kwargs)

Make it possible to specify train, validation path.

class.extend_dir: specify train path. class.validation_extend_dir: specify validation path.

When validation_extend_dir doesn’t set, generate validation data from train set. You should implement the validation subset split from train data with validation_size in sub class.

available_subsets = ['train', 'validation']
property _train_data_dir(self)
property _validation_data_dir(self)
property data_dir(self)