25 Commits (b8b9f059f9ae3d3945f9f531d768cecad80360e0)

Author SHA1 Message Date
Maxim Zhiltsov 0280b5fb64
Add simple filters for collections (#5575)
Added simple filter queries for collections in the server API. Such
queries should cover simpler cases, while more complex filters should
use the JSON syntax.

- Added simple filters for collection endpoints in API (e.g.
`/tasks?project_id=42&user=myusername`)
- Removed duplicating collection endpoints in API in favor of their full
versions:
  - `/projects/{id}/tasks` -> `/tasks?project_id={id}`
  - `/tasks/{id}/jobs` -> `/jobs?task_id={id}`
  - `/jobs/{id}/issues` -> `/issues?job_id={id}`
  - `/issue/{id}/comments` -> `/comments?issue_id={id}`
  - Corresponding owning objects now return a link to the collection:
    - `/projects/{id}`: `.tasks`
    - `/tasks/{id}`: `.jobs`
    - `/jobs/{id}`: `.issues`
    - `/issue/{id}`: `.comments`
- Fixed errors in the generated server API schema:
- Input and output types in all the basic model methods (`Create`,
`Update`, `Retrieve`, `Delete`)
- Removed invalid separation for the project list operation response
type
- File structure for projects in the dataset cache is updated to store
the new project representation. Old caches will be invalidated.
- Added tests
3 years ago
Roman Donchenko 33c624ae1e
PyTorch adapter: add a way to disable cache updates (#5549)
This will let users to run their PyTorch code without network access,
provided that they have already cached the data.

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->
Unit tests.
3 years ago
Maxim Zhiltsov c808471d84
Improve SDK UX with task creation (#5502)
Extracted from https://github.com/opencv/cvat/pull/5083

- Added a default arg for task data uploading
- Added an option to wait for the data processing in task data uploading
- Moved data splitting by requests for TUS closer to the point of use
3 years ago
Roman Donchenko ce37be1f60
SDK: add a ProjectVisionDataset class (#5523) 3 years ago
Roman Donchenko 4d32c3c686
SDK: make the dataset cache directory customizable (#5535)
This is useful for people whose home directory is too small/not fast
enough. It also lets us make the tests less hacky.
3 years ago
Andrey Zhavoronkov 52e3f3c28a
Added tests for preview endpoints (#5529) 3 years ago
Maxim Zhiltsov af65707eee
Mark tests that require external services (#5474)
Related: #5225 

External services are not available when we execute in Helm.

- Added a way to mark REST API tests that require external services to
run
- Changed the way of filtering tests in Helm tests

Currently, we can't execute external service mocks in tests, and we
ignore related tests in the Helm
execution command. But this command may be outdated, because Helm tests
are not executed in each PR.
This PR allows to indicate related tests and filter them out without the
need to synchronize the CI command.
3 years ago
Roman Donchenko fa92ccb987
SDK: Improve the PyTorch adapter layer (#5455)
* Make the extractors return tensors instead of Python data structures.
* Let the user specify custom label IDs.
3 years ago
Maxim Zhiltsov 6cf67dba9e
Add project proxy tests in SDK (#5431)
Ported from https://github.com/opencv/cvat/pull/4819

- Fixed project APIs in SDK core
- Added tests for projects
3 years ago
Roman Donchenko 487c60ce2b
SDK: Add an adapter layer that presents a CVAT task as a torchvision dataset (#5417) 3 years ago
Roman Donchenko 0a032b3236
Migrate to using pathlib in most of the SDK (#5435)
For user-facing functions, keep accepting `str` paths to maintain
compatibility and flexibility, but add support for arbitrary path-like
objects. For internal functions (in `downloading.py` and
`uploading.py`), don't bother and require `pathlib.Path`.

The only code that isn't converted is build-time code (e.g. `setup.py`)
and code that came from openapi-generator.
3 years ago
Roman Donchenko 481630e719
Migrate tests/python to from os.path to pathlib (#5426)
`pathlib` improves code readability and type safety. It is already used
in some of the tests; convert all remaining `os.path` usage to `pathlib`
equivalents.
3 years ago
Roman Donchenko 192fd72680
Fix creation of tasks with Git repositories via the SDK (#5409)
Fixes #4365
3 years ago
Roman Donchenko 0a16cfce5b
SDK: add a high-level method to download task data chunks (#5356) 3 years ago
Roman Donchenko aadfd8814e
Fix TUS offset queries in production environments (#5204)
* Fix TUS offset queries in production environments

Previously, `mod_wsgi` would convert `HEAD` requests into `GET`, which
would be rejected, so clients were unable to resume an upload that failed
midway through.

To make use of this, update the SDK code to enable upload resumption.

* Add a test that forces a chunked TUS upload

* test_can_create_from_backup_in_chunks: make sure the upload is actually chunked
3 years ago
Kirill Sizov ce09f28512
Fix SDK tests: login once per class (#5123) 3 years ago
Aleksey Alekseev c3dd3499e3
Added Cypress testing for feature: Multiple tasks creating from videos (#5028)
* add tests for try of creating multitasks with images and video

* add tests seccess creating video with Remote source

* reduce time of debounce

* try fix 107, 118 tests

* try fix 107 tests

* fix test with attach video

* disable test with attach video

* fix url to remote videos

* Aborted extra changes

* Updated files

* Refactored case 107

* Fixed almost all tests

* Aborted extra changes

* removed extra files

* Improved tests, added tests for local videos

* Fixed corner case

* Fix ://

* Redesigned a way of getting a file type

* Added html type to button

* Some refactoring

* Removed extra file

* sdk tests: fix path for file share images

Co-authored-by: Boris <sekachev.bs@gmail.com>
Co-authored-by: kirill-sizov <sizow.k.d@gmail.com>
3 years ago
Maxim Zhiltsov 511f9706d5
Allow trailing slashes in SDK client url (#5057) 3 years ago
Роман Донченко b029bc9da8
cvat-sdk: Fix creating tasks with non-local files (#5058)
* Move the test file share contents to tests/share

This way, it can be reused between tests.

* cvat-sdk: Fix creating tasks with non-local files

Forcing the `Content-Type` for the `upload_data` API call to
`multipart/form-data` does not work, because the current logic for
converting Python values to parts (`ApiClient._convert_body_to_post_params`)
does not encode them in a way that Django REST Framework can understand (it
JSON-encodes each part).

Fortunately, we don't actually need to do that, since when we create a task
with non-local files, we don't need to upload any files, and so we can just
post the original JSON, so do just that.

I couldn't add a test for the remote image case, because CVAT rejects all URLs
with non-public IP addressses. However, I did test this case manually.
3 years ago
Maxim Zhiltsov 2e15025434
Check server version in SDK (#4935) 3 years ago
Anastasia Yasakova ddcee5b3a9
REST API tests with skeletons (#4987) 3 years ago
Maxim Zhiltsov 68375ec23e
Add SDK docs (#4928)
- Added auth docs in API schema and SDK ApiClient/Config (fixes #1517)
- Added SDK docs with API, SDK and CLI docs
- Added `develop` branch in the docs
- Allowed unauthorized access to `api/docs`, `api/swagger`, `api/schema` endpoints
- Added `--insecure` env var to control host checks in CLI
- Refactored `build_docs.py` (backported https://github.com/openvinotoolkit/datumaro/pull/589)
- Extracted requirements file for site
3 years ago
Maxim Zhiltsov 7218f4e283
Add host schema auto-detection in SDK (#4910) 3 years ago
Maxim Zhiltsov 53697ecac5
SDK layer 2 - cover RC1 usecases (#4813) 4 years ago
Maxim Zhiltsov 5f58a0f7be
Add 2nd layer of SDK (#19) 4 years ago