add overlap & segment_size flag for python cli task create (#1950)

Thanks you so much
main
Young 6 years ago committed by GitHub
parent 6eb777a935
commit 3f6d2e9e4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 (<https://github.com/opencv/cvat/pull/1192>)
- Source type support for CVAT Dumper/Loader (<https://github.com/opencv/cvat/pull/1192>)
- Intelligent polygon editing (<https://github.com/opencv/cvat/pull/1921>)
- Support creating multiple jobs for each task through python cli (https://github.com/opencv/cvat/pull/1950)
- python cli over https (<https://github.com/opencv/cvat/pull/1942>)
### Changed

@ -58,7 +58,7 @@ class CLI():
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 @@ class CLI():
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)

@ -112,6 +112,18 @@ task_create_parser.add_argument(
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='',

@ -27,7 +27,7 @@ class TestCLI(APITestCase):
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

Loading…
Cancel
Save