DatasetAdapter

class cocohelper.adapters.dataset_adapter.DatasetAdapter[source]

Bases: ABC

Method List

get_categories()

Get the categories.

get_sample(idx)

A method for loading samples.

read_image(idx)

A method for reading images.

Attributes List

_abc_impl

Methods Details

abstract get_categories()[source]

Get the categories.

Returns:

A list of categories as dictionaries.

Return type:

List[dict]

abstract get_sample(idx)[source]

A method for loading samples. To be implemented.

Parameters:

idx (int) – index of the element to be fetched.

Returns:

A tuple of a dictionary or list of dictionaries.

Return type:

Optional[Tuple[dict, List[dict]]]

abstract read_image(idx)[source]

A method for reading images. To be implemented.

Parameters:

idx (int) – index of the element to be fetched.

Returns:

A numpy array with the image.

Return type:

ndarray

Attribute Details

_abc_impl = <_abc._abc_data object>