diff --git a/CHANGELOG.md b/CHANGELOG.md index b297e626e5ec..ab76d93ded06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Source type support for tags, shapes and tracks () - Source type support for CVAT Dumper/Loader () - Intelligent polygon editing () +- Support creating multiple jobs for each task through python cli (https://github.com/opencv/cvat/pull/1950) - python cli over https () ### Changed diff --git a/utils/cli/core/core.py b/utils/cli/core/core.py index a9386884998d..78a2776c27e3 100644 --- a/utils/cli/core/core.py +++ b/utils/cli/core/core.py @@ -58,7 +58,7 @@ def tasks_list(self, use_json_output, **kwargs): response = self.session.get(url) response.raise_for_status() - def tasks_create(self, name, labels, bug, resource_type, resources, + def tasks_create(self, name, labels, overlap, segment_size, bug, resource_type, resources, annotation_path='', annotation_format='CVAT XML 1.1', completion_verification_period=20, **kwargs): """ Create a new task with the given name and labels JSON and @@ -66,6 +66,8 @@ def tasks_create(self, name, labels, bug, resource_type, resources, url = self.api.tasks data = {'name': name, 'labels': labels, + 'overlap': overlap, + 'segment_size': segment_size, 'bug_tracker': bug, } response = self.session.post(url, json=data) diff --git a/utils/cli/core/definition.py b/utils/cli/core/definition.py index 4e1937ebf5ea..c30eae07292d 100644 --- a/utils/cli/core/definition.py +++ b/utils/cli/core/definition.py @@ -112,6 +112,18 @@ def argparse(s): type=parse_label_arg, help='string or file containing JSON labels specification' ) +task_create_parser.add_argument( + '--overlap', + default=0, + type=int, + help='the number of intersected frames between different segments' +) +task_create_parser.add_argument( + '--segment_size', + default=0, + type=int, + help='the number of frames in a segment' +) task_create_parser.add_argument( '--bug', default='', diff --git a/utils/cli/tests/_test_cli.py b/utils/cli/tests/_test_cli.py index 3977159cc657..a792633dc402 100644 --- a/utils/cli/tests/_test_cli.py +++ b/utils/cli/tests/_test_cli.py @@ -27,7 +27,7 @@ def setUp(self, mock_stdout): self.taskname = 'test_task' self.cli.tasks_create(self.taskname, [{'name' : 'car'}, {'name': 'person'}], - '', + 0, 0, '', ResourceType.LOCAL, [self.img_file]) # redirect logging to mocked stdout to test program output