Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add several flags to task_create CLI #4119

Merged
merged 12 commits into from
Jan 13, 2022

Conversation

theteleforce
Copy link
Contributor

@theteleforce theteleforce commented Jan 5, 2022

Motivation and context

The current CLI is very helpful for automation, but lacks the ability to set several parameters. This pull request adds flags for setting chunk_size, start_frame, stop_frame, and use_zip_chunks & fixes #3855.

This pull request also fixes several kinks with the task_create CLI:

  • The bug_tracker parameter can now be passed with --bug_tracker as well as the previous flag --bug.
  • Optional flags are no longer included in every request, to remain consistent with the website.
  • Optional flags are checked in a single loop instead of several if statements, making it easier to add flags in the future.
  • Optional flags are now passed as **kwargs instead of positional args.

How has this been tested?

The updated create function has been called successfully from the CLI on Windows 10 (build 19043).

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

theteleforce and others added 7 commits January 4, 2022 17:07
definition.py:
	- Add use_zip_chunks, start_frame, stop_frame, and chunk_size
	  as CLI flags
	- Rename --bug to --bug_tracker to be consistent with website
	  and API
	- No longer include optional kwargs in all requests
core.py:
	- Add a single loop to handle all kwargs for extensibility
	- Lump optional task_create args into kwargs for brevity
- Add back old --bug flag for backwards compatability
Update licence header for core.py
- Remove hardcoded `image_quality` default value, as this is already
  handled by the argparse default value.
@theteleforce theteleforce marked this pull request as ready for review January 5, 2022 20:46
@azhavoro azhavoro self-assigned this Jan 10, 2022
- Several linting fixes for CLI
Copy link
Contributor

@azhavoro azhavoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please fix pylint warnings
pylint_report (2).zip

utils/cli/core/core.py Show resolved Hide resolved
@azhavoro
Copy link
Contributor

Thanks for the contribution!

theteleforce and others added 2 commits January 12, 2022 16:02
- Re-add default image_quality in case task_create is called manually
@theteleforce
Copy link
Contributor Author

Linting warnings have been fixed -- thanks for the heads-up. I have also re-added a hardcoded default of 70 for image_quality -- didn't think about tasks_create being called without the CLI. This default value is consistent with the website, but could go back to 50 if we wanted.

Please do let me know if anything else needs to be done!

CHANGELOG.md Show resolved Hide resolved
azhavoro
azhavoro previously approved these changes Jan 13, 2022
Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution.

@nmanovic nmanovic merged commit c83d170 into cvat-ai:develop Jan 13, 2022
@nmanovic nmanovic mentioned this pull request Mar 4, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chunk Size in CLI
3 participants