:py:mod:`kwcoco.examples.getting_started_existing_dataset` ========================================================== .. py:module:: kwcoco.examples.getting_started_existing_dataset Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: kwcoco.examples.getting_started_existing_dataset.getting_started_existing_dataset kwcoco.examples.getting_started_existing_dataset.the_core_dataset_backend kwcoco.examples.getting_started_existing_dataset.demo_vectorize_interface .. py:function:: getting_started_existing_dataset() If you want to start using the Python API. Just open IPython and try: .. py:function:: the_core_dataset_backend() .. py:function:: demo_vectorize_interface() >>> import kwcoco >>> dset = kwcoco.CocoDataset.demo('vidshapes2') >>> # >>> aids = [1, 2, 3, 4] >>> annots = dset.annots(aids) ... >>> print('annots = {!r}'.format(annots)) annots = >>> annots.lookup('bbox') [[346.5, 335.2, 33.2, 99.4], [344.5, 327.7, 48.8, 111.1], [548.0, 154.4, 57.2, 62.1], [548.7, 151.0, 59.4, 80.5]] >>> gids = annots.lookup('image_id') >>> print('gids = {!r}'.format(gids)) gids = [1, 2, 1, 2] >>> images = dset.images(gids) >>> list(zip(images.lookup('width'), images.lookup('height'))) [(600, 600), (600, 600), (600, 600), (600, 600)]