:py:mod:`kwcoco.data.grab_camvid` ================================= .. py:module:: kwcoco.data.grab_camvid .. autoapi-nested-parse:: Downloads the CamVid data if necessary, and converts it to COCO. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: kwcoco.data.grab_camvid._devcheck_sample_full_image kwcoco.data.grab_camvid._devcheck_load_sub_image kwcoco.data.grab_camvid.grab_camvid_train_test_val_splits kwcoco.data.grab_camvid.grab_camvid_sampler kwcoco.data.grab_camvid.grab_coco_camvid kwcoco.data.grab_camvid.grab_raw_camvid kwcoco.data.grab_camvid.rgb_to_cid kwcoco.data.grab_camvid.cid_to_rgb kwcoco.data.grab_camvid.convert_camvid_raw_to_coco kwcoco.data.grab_camvid._define_camvid_class_hierarcy kwcoco.data.grab_camvid.main .. py:function:: _devcheck_sample_full_image() .. py:function:: _devcheck_load_sub_image() .. py:function:: grab_camvid_train_test_val_splits(coco_dset, mode='segnet') .. py:function:: grab_camvid_sampler() Grab a kwcoco.CocoSampler object for the CamVid dataset. :returns: sampler :rtype: kwcoco.CocoSampler .. rubric:: Example >>> # xdoctest: +REQUIRES(--download) >>> sampler = grab_camvid_sampler() >>> print('sampler = {!r}'.format(sampler)) >>> # sampler.load_sample() >>> for gid in ub.ProgIter(sampler.image_ids, desc='load image'): >>> img = sampler.load_image(gid) .. py:function:: grab_coco_camvid() .. rubric:: Example >>> # xdoctest: +REQUIRES(--download) >>> dset = grab_coco_camvid() >>> print('dset = {!r}'.format(dset)) >>> # xdoctest: +REQUIRES(--show) >>> import kwplot >>> plt = kwplot.autoplt() >>> plt.clf() >>> dset.show_image(gid=1) .. py:function:: grab_raw_camvid() Grab the raw camvid data. .. py:function:: rgb_to_cid(r, g, b) .. py:function:: cid_to_rgb(cid) .. py:function:: convert_camvid_raw_to_coco(camvid_raw_info) Converts the raw camvid format to an MSCOCO based format, ( which lets use use kwcoco's COCO backend). .. rubric:: Example >>> # xdoctest: +REQUIRES(--download) >>> camvid_raw_info = grab_raw_camvid() >>> # test with a reduced set of data >>> del camvid_raw_info['img_paths'][2:] >>> del camvid_raw_info['mask_paths'][2:] >>> dset = convert_camvid_raw_to_coco(camvid_raw_info) >>> # xdoctest: +REQUIRES(--show) >>> import kwplot >>> plt = kwplot.autoplt() >>> kwplot.figure(fnum=1, pnum=(1, 2, 1)) >>> dset.show_image(gid=1) >>> kwplot.figure(fnum=1, pnum=(1, 2, 2)) >>> dset.show_image(gid=2) .. py:function:: _define_camvid_class_hierarcy(dset) .. py:function:: main() Dump the paths to the coco file to stdout By default these will go to in the path: ~/.cache/kwcoco/camvid/camvid-master The four files will be: ~/.cache/kwcoco/camvid/camvid-master/camvid-full.mscoco.json ~/.cache/kwcoco/camvid/camvid-master/camvid-train.mscoco.json ~/.cache/kwcoco/camvid/camvid-master/camvid-vali.mscoco.json ~/.cache/kwcoco/camvid/camvid-master/camvid-test.mscoco.json