kwcoco.cli.coco_toydata module

class kwcoco.cli.coco_toydata.CocoToyDataCLI[source]

Bases: object

name = 'toydata'
class CLIConfig(data=None, default=None, cmdline=False)[source]

Bases: Config

Create COCO toydata for demo and testing purposes.

Parameters:
  • data (object) – filepath, dict, or None

  • default (dict | None) – overrides the class defaults

  • cmdline (bool | List[str] | str | dict) – If False, then no command line information is used. If True, then sys.argv is parsed and used. If a list of strings that used instead of sys.argv. If a string, then that is parsed using shlex and used instead

    of sys.argv.

    If a dictionary grants fine grained controls over the args passed to Config._read_argv(). Can contain:

    • strict (bool): defaults to False

    • argv (List[str]): defaults to None

    • special_options (bool): defaults to True

    • autocomplete (bool): defaults to False

    Defaults to False.

Note

Avoid setting cmdline parameter here. Instead prefer to use the cli classmethod to create a command line aware config instance..

epilog = '\n        Example Usage:\n            kwcoco toydata --key=shapes8 --dst=toydata.kwcoco.json\n\n            kwcoco toydata --key=shapes8 --bundle_dpath=my_test_bundle_v1\n            kwcoco toydata --key=shapes8 --bundle_dpath=my_test_bundle_v1\n\n            kwcoco toydata \\\n                --key=vidshapes1-frames32 \\\n                --dst=./mytoybundle/dataset.kwcoco.json\n\n        TODO:\n            - [ ] allow specification of images directory\n        '
default = {'bundle_dpath': <Value(None)>, 'dst': <Value(None)>, 'key': <Value('shapes8')>, 'use_cache': <Value(True)>, 'verbose': <Value(False)>}
classmethod main(cmdline=True, **kw)[source]

Example

>>> from kwcoco.cli.coco_toydata import *  # NOQA
>>> import ubelt as ub
>>> dpath = ub.Path.appdir('kwcoco/tests/cli/demo').ensuredir()
>>> kw = {'key': 'shapes8', 'dst': dpath / 'test.json'}
>>> cmdline = False
>>> cls = CocoToyDataCLI
>>> cls.main(cmdline, **kw)
kwcoco.cli.coco_toydata._CLI

alias of CocoToyDataCLI