samlab.dashboard.backend.images module

Warning

module ‘samlab.dashboard.backend.images’ undocumented

class samlab.dashboard.backend.images.COCO(*, name, annotations, images)[source]

Bases: ImageCollection

Warning

class ‘samlab.dashboard.backend.images.COCO’ undocumented

bboxes(index)[source]

Return a list of bounding box annotations for an image.

Parameters

index (int, required) – Index of the image.

Returns

bboxes – Sequence of dict, one per bounding box. Each dict must have “left”, “top”, “width”, “height”, “category”, and “color” keys.

Return type

list

property categories

Return a list of existing categories for the collection.

Returns

categories – Sequence of str, one per category, with a unique category name.

Return type

list

get(index)[source]

Return an image.

Parameters

index (int, required) – The index of the image to return.

Returns

image – If str, the filesystem path of the image.

Return type

str

metadata(index)[source]

Warning

method ‘samlab.dashboard.backend.images.COCO.metadata’ undocumented

property name

Warning

property ‘samlab.dashboard.backend.images.COCO.name’ undocumented

tags(index)[source]

Warning

method ‘samlab.dashboard.backend.images.COCO.tags’ undocumented

class samlab.dashboard.backend.images.Directory(*, name, root, pattern='.*\\.(png|jpg|jpeg|PNG|JPG|JPEG)')[source]

Bases: ImageCollection

Warning

class ‘samlab.dashboard.backend.images.Directory’ undocumented

get(index)[source]

Return an image.

Parameters

index (int, required) – The index of the image to return.

Returns

image – If str, the filesystem path of the image.

Return type

str

property name

Warning

property ‘samlab.dashboard.backend.images.Directory.name’ undocumented

tags(index)[source]

Warning

method ‘samlab.dashboard.backend.images.Directory.tags’ undocumented

class samlab.dashboard.backend.images.ImageCollection[source]

Bases: ABC

Warning

class ‘samlab.dashboard.backend.images.ImageCollection’ undocumented

bboxes(index)[source]

Return a list of bounding box annotations for an image.

Parameters

index (int, required) – Index of the image.

Returns

bboxes – Sequence of dict, one per bounding box. Each dict must have “left”, “top”, “width”, “height”, “category”, and “color” keys.

Return type

list

property categories

Return a list of existing categories for the collection.

Returns

categories – Sequence of str, one per category, with a unique category name.

Return type

list

abstract get(index)[source]

Return an image.

Parameters

index (int, required) – The index of the image to return.

Returns

image – If str, the filesystem path of the image.

Return type

str

metadata(index)[source]

Warning

method ‘samlab.dashboard.backend.images.ImageCollection.metadata’ undocumented

abstract property name

Warning

property ‘samlab.dashboard.backend.images.ImageCollection.name’ undocumented

put_bboxes(index, bboxes)[source]

Warning

method ‘samlab.dashboard.backend.images.ImageCollection.put_bboxes’ undocumented

put_tags(index, tags)[source]

Warning

method ‘samlab.dashboard.backend.images.ImageCollection.put_tags’ undocumented

property service

Warning

property ‘samlab.dashboard.backend.images.ImageCollection.service’ undocumented

tags(index)[source]

Warning

method ‘samlab.dashboard.backend.images.ImageCollection.tags’ undocumented

class samlab.dashboard.backend.images.ImageNet(*, name, root, split)[source]

Bases: ImageCollection

Warning

class ‘samlab.dashboard.backend.images.ImageNet’ undocumented

get(index)[source]

Return an image.

Parameters

index (int, required) – The index of the image to return.

Returns

image – If str, the filesystem path of the image.

Return type

str

property name

Warning

property ‘samlab.dashboard.backend.images.ImageNet.name’ undocumented

tags(index)[source]

Warning

method ‘samlab.dashboard.backend.images.ImageNet.tags’ undocumented