diff --git a/utils/cli/core/core.py b/utils/cli/core/core.py index facd17d4..5f126a04 100644 --- a/utils/cli/core/core.py +++ b/utils/cli/core/core.py @@ -1,4 +1,4 @@ -# Copyright (C) 2020 Intel Corporation +# Copyright (C) 2020-2021 Intel Corporation # # SPDX-License-Identifier: MIT @@ -23,7 +23,7 @@ class CLI(): self.session = session self.login(credentials) - def tasks_data(self, task_id, resource_type, resources): + def tasks_data(self, task_id, resource_type, resources, **kwargs): """ Add local, remote, or shared files to an existing task. """ url = self.api.tasks_id_data(task_id) data = {} @@ -35,6 +35,13 @@ class CLI(): elif resource_type == ResourceType.SHARE: data = {'server_files[{}]'.format(i): f for i, f in enumerate(resources)} data['image_quality'] = 50 + + ## capture additional kwargs + if 'image_quality' in kwargs: + data['image_quality'] = kwargs.get('image_quality') + if 'frame_step' in kwargs: + data['frame_filter'] = f"step={kwargs.get('frame_step')}" + response = self.session.post(url, data=data, files=files) response.raise_for_status() @@ -85,7 +92,7 @@ class CLI(): response_json = response.json() log.info('Created task ID: {id} NAME: {name}'.format(**response_json)) task_id = response_json['id'] - self.tasks_data(task_id, resource_type, resources) + self.tasks_data(task_id, resource_type, resources, **kwargs) if annotation_path != '': url = self.api.tasks_id_status(task_id) diff --git a/utils/cli/core/definition.py b/utils/cli/core/definition.py index 48e11456..db44551e 100644 --- a/utils/cli/core/definition.py +++ b/utils/cli/core/definition.py @@ -181,7 +181,20 @@ task_create_parser.add_argument( action='store_true', help='using lfs for dataset repository (default: %(default)s)' ) - +task_create_parser.add_argument( + '--image_quality', + default=70, + type=int, + help='''set the image quality option in the advanced configuration + when creating tasks.(default: %(default)s)''' +) +task_create_parser.add_argument( + '--frame_step', + default=1, + type=int, + help='''set the frame step option in the advanced configuration + when uploading image series or videos (default: %(default)s)''' +) ####################################################################### # Delete ####################################################################### @@ -296,4 +309,4 @@ upload_parser.add_argument( type=str, default='CVAT 1.1', help='annotation format (default: %(default)s)' -) \ No newline at end of file +)