kwcoco.coco_image

Module Contents

Classes

CocoImage

An object-oriented representation of a coco image.

class kwcoco.coco_image.CocoImage(img, dset=None)[source]

Bases: ubelt.NiceRepr

An object-oriented representation of a coco image.

It provides helper methods that are specific to a single image.

This operates directly on a single coco image dictionary, but it can optionally be connected to a parent dataset, which allows it to use CocoDataset methods to query about relationships and resolve pointers.

This is different than the Images class in coco_object1d, which is just a vectorized interface to multiple objects.

Example

>>> import kwcoco
>>> dset = kwcoco.CocoDataset.demo('shapes8')
>>> self = dset._coco_image(1)
>>> dset = kwcoco.CocoDataset.demo('vidshapes8-multispectral')
>>> self = dset._coco_image(1)
__nice__(self)[source]
__getitem__(self, key)[source]
get(self, key, default=ub.NoParam)[source]

Duck type some of the dict interface

property dsize(self)[source]
_iter_asset_objs(self)[source]

Iterate through base + auxiliary dicts that have file paths