kwcoco.data.grab_camvid module¶
Downloads the CamVid data if necessary, and converts it to COCO.
- kwcoco.data.grab_camvid.grab_camvid_sampler()[source]¶
Grab a kwcoco.CocoSampler object for the CamVid dataset.
- Returns
sampler
- Return type
kwcoco.CocoSampler
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)
- kwcoco.data.grab_camvid.grab_coco_camvid()[source]¶
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)
- kwcoco.data.grab_camvid.convert_camvid_raw_to_coco(camvid_raw_info)[source]¶
Converts the raw camvid format to an MSCOCO based format, ( which lets use use kwcoco’s COCO backend).
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)
- kwcoco.data.grab_camvid.main()[source]¶
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