kwcoco.cli.coco_move module¶
- class kwcoco.cli.coco_move.CocoMove(*args, **kwargs)[source]¶
Bases:
DataConfig
Move a kwcoco file to a new location while maintaining relative paths. This is equivalent to a regular copy followed by
kwcoco reroot
followed by a delete of the original.TODO: add option to move the assets as well?
Valid options: []
- Parameters
*args – positional arguments for this data config
**kwargs – keyword arguments for this data config
- classmethod main(cmdline=1, **kwargs)[source]¶
Example
>>> import ubelt as ub >>> from kwcoco.cli import coco_move >>> import kwcoco >>> dpath = ub.Path.appdir('kwcoco/doctest/move') >>> dpath.delete().ensuredir() >>> dset = kwcoco.CocoDataset.demo('vidshapes2', dpath=dpath) >>> cmdline = 0 >>> dst = (ub.Path(dset.bundle_dpath) / 'new_dpath').ensuredir() >>> kwargs = dict(src=dset.fpath, dst=dst) >>> coco_move.CocoMove.main(cmdline=cmdline, **kwargs) >>> assert dst.exists() >>> assert not ub.Path(dset.fpath).exists()
- default = {'absolute': <Value(False)>, 'check': <Value(True)>, 'dst': <Value(None)>, 'src': <Value(None)>}¶