kwcoco.cli.coco_reroot

Module Contents

Classes

CocoRerootCLI

Attributes

_CLI

class kwcoco.cli.coco_reroot.CocoRerootCLI[source]
class CLIConfig(data=None, default=None, cmdline=False)[source]

Bases: scriptconfig.Config

Reroot image paths onto a new image root.

Modify the root of a coco dataset such to either make paths relative to a new root or make paths absolute.

Todo

  • [ ] Evaluate that all tests cases work

epilog = Multiline-String[source]
Show Value
1        Example Usage:
2            kwcoco reroot --help
3            kwcoco reroot --src=special:shapes8 --dst rerooted.json
4            kwcoco reroot --src=special:shapes8 --new_prefix=foo --check=True --dst rerooted.json
default[source]
name = reroot[source]
classmethod main(cls, cmdline=True, **kw)[source]

Example

>>> # xdoctest: +SKIP
>>> kw = {'src': 'special:shapes8'}
>>> cmdline = False
>>> cls = CocoRerootCLI
>>> cls.main(cmdline, **kw)
Ignore:

python ~/code/kwcoco/kwcoco/cli/coco_reroot.py –src=$HOME/code/bioharn/fast_test/deep_training/training_truth.json –dst=$HOME/code/bioharn/fast_test/deep_training/training_truth2.json –new_prefix=/home/joncrall/code/bioharn/fast_test/training_data –old_prefix=/run/media/matt/Storage/TEST/training_data

python ~/code/kwcoco/kwcoco/cli/coco_reroot.py –src=$HOME/code/bioharn/fast_test/deep_training/validation_truth.json –dst=$HOME/code/bioharn/fast_test/deep_training/validation_truth2.json –new_prefix=/home/joncrall/code/bioharn/fast_test/training_data –old_prefix=/run/media/matt/Storage/TEST/training_data

cmdline = ‘’’

–src=$HOME/code/bioharn/fast_test/deep_training/training_truth.json –dst=$HOME/code/bioharn/fast_test/deep_training/training_truth2.json –new_prefix=/home/joncrall/code/bioharn/fast_test/training_data –old_prefix=/run/media/matt/Storage/TEST/training_data

‘’’

/run/media/matt/Storage/TEST/training_data –check=True –dst rerooted.json

kwcoco.cli.coco_reroot._CLI[source]