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 filename pattern to cli #5525

Merged
merged 8 commits into from
Dec 31, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## \[2.4.0] - Unreleased
### Added
- Filename pattern to simplify uploading cloud storage data for a task (<https://github.com/opencv/cvat/pull/5498>)
- Filename pattern to simplify uploading cloud storage data for a task (<https://github.com/opencv/cvat/pull/5498>, <https://github.com/opencv/cvat/pull/5525>)

### Changed
- TDB
Expand Down
16 changes: 16 additions & 0 deletions cvat-cli/src/cvat_cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,22 @@ def make_cmdline_parser() -> argparse.ArgumentParser:
action="store_true", # automatically sets default=False
help="""zip chunks before sending them to the server""",
)
task_create_parser.add_argument(
"--cloud_storage_id",
default=None,
type=int,
help="cloud storage ID if you would like to use data from cloud storage",
)
task_create_parser.add_argument(
"--filename_pattern",
type=str,
help="""pattern for filtering data from the manifest file for the upload.
zhiltsov-max marked this conversation as resolved.
Show resolved Hide resolved
Only shell-style wildcards are supported:
* - matches everything
? - matches any single character
[seq] - matches any character in 'seq'
nmanovic marked this conversation as resolved.
Show resolved Hide resolved
[!seq] - matches any character not in seq""",
)

#######################################################################
# Delete
Expand Down
2 changes: 2 additions & 0 deletions cvat-sdk/cvat_sdk/core/proxies/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def upload_data(
"stop_frame",
"use_cache",
"use_zip_chunks",
"filename_pattern",
"cloud_storage_id",
],
)
)
Expand Down
12 changes: 12 additions & 0 deletions site/content/en/docs/api_sdk/cli/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ by using the [label constructor](/docs/manual/basics/creating_an_annotation_task
--dataset_repository_url https://github.com/user/dataset/blob/main/annotation/anno_file_name.zip \
--lfs share //share/large_dataset/images/
```
- Create a task named "task with filtered cloud storage data", with filename_pattern `test_images/*.jpeg`
and using the data from the cloud storage resource described in the manifest.jsonl:
```bash
cvat-cli create "task with filtered cloud storage data" --labels '[{"name": "car"}]'\
--use_cache --cloud_storage_id 1 --filename_pattern "test_images/*.jpeg" share manifest.jsonl
```
- Create a task named "task with filtered cloud storage data" using all data from the cloud storage resource
described in the manifest.jsonl by specifying filename_pattern `*`:
```bash
cvat-cli create "task with filtered cloud storage data" --labels '[{"name": "car"}]'\
--use_cache --cloud_storage_id 1 --filename_pattern "*" share manifest.jsonl
```

### Delete

Expand Down