-
Notifications
You must be signed in to change notification settings - Fork 3k
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 SDK docs #4928
Add SDK docs #4928
Conversation
@@ -0,0 +1,31 @@ | |||
--- | |||
title: "Integration" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the topic. From my perspective integrations are more about collaboration with external tools (see https://voxel51.com/docs/fiftyone/integrations/index.html). The topic about our REST API, SDK, and CLI. Probably the best option is to just have 3 separate topics: REST API, SDK, CLI. Look at https://docs.labelbox.com/docs as well. I like the documentation structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see all the variants in different tools:
- Labelbox: API & SDK
- 51: API, CLI
- Label studio: Integrations (API, SDK, CLI)
- Superannotate: SDK (+CLI); Integrations (with others + their dataset format)
- v7: SDK; CLI; API
Probably, I agree about separate sections for SDK and CLI, but not sure about API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed section name to API & SDK
. The API & SDK & CLI
, API, SDK & CLI
variants look clumsy to my taste, and SDK can also suppose CLI by its meaning, so it shouldn't be a big loss.
/check |
❌ Some checks failed |
README.md
Outdated
- [Datumaro dataset framework](https://github.com/cvat-ai/datumaro/blob/develop/README.md) | ||
- [Command line interface](https://opencv.github.io/cvat/docs/manual/advanced/cli/) | ||
- [Server API](https://opencv.github.io/cvat/docs/integration/api/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it still a valid link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you have added the information below. Should we remove these 3 links?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to have these links. Maybe, we could provide a TOC section in the beginning? It will simplify navigation for users, because the current page is quite long. Example from Datumaro:
Then, the link will just navigate to the section below.
cvat-cli/src/cvat_cli/parser.py
Outdated
@@ -14,6 +14,8 @@ | |||
|
|||
from .version import VERSION | |||
|
|||
SSL_VERIFICATION_ENV_VAR = "SSL_VERIFY" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SSL_NO_VERIFY is more or less standard name for the variable (e.g., conda, git use it with a prefix)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, from popular tools, only these 2 tools use variables at all:
curl: --insecure
wget: --no-check-certificate
pip: install ... --global http.sslVerify false
apt: -o "Acquire::https::Verify-Peer=false" ...
git: GIT_SSL_NO_VERIFY=true git
git: config http.sslVerify "false"
conda: SSL_NO_VERIFY=1 conda ...
npm: config set strict-ssl false
maven: -Dmaven.wagon.http.ssl.insecure=true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to only use the --insecure
arg instead.
cvat-cli/src/cvat_cli/parser.py
Outdated
@@ -47,6 +49,12 @@ def make_cmdline_parser() -> argparse.ArgumentParser: | |||
description="Perform common operations related to CVAT tasks.\n\n" | |||
) | |||
parser.add_argument("--version", action="version", version=VERSION) | |||
parser.add_argument( | |||
"--ssl-verify", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the same time, the argument name is correct. I don't know why for an env variable and a command line argument the different convention is used.
weight: 29 | ||
description: 'Guide to working with CVAT tasks in the command line interface. This section on [GitHub](https://github.com/cvat-ai/cvat/tree/develop/cvat-cli).' | ||
weight: 4 | ||
description: '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: '' | |
description: 'Python command line interface to interact with a CVAT instance' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description is only displayed as an extra line under the title. I'm not sure this description adds anything to the title
simplify server interaction and provide additional functionality like data validation. | ||
|
||
SDK API includes 2 layers: | ||
- Low-level API with REST API wrappers. Located in at `cvat_sdk.api_client`. [Read more](/integration/sdk/lowlevel-api) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhiltsov-max , the link is broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed links
Co-authored-by: Nikita Manovich <[email protected]>
Co-authored-by: Nikita Manovich <[email protected]>
Co-authored-by: Nikita Manovich <[email protected]>
a command line tool, browser or a script - all interact with CVAT via HTTP requests and | ||
responses: | ||
|
||
![CVAT server interaction image](/images/server_api_interaction.svg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will prefer to have a console icon instead of a user and a list (python script?). Probably you want to ask Alexander to draw a picture for you after he comes back from vacation.
# Here we will use models instead of a dict | ||
task_data = models.DataRequest( | ||
image_quality=75, | ||
start_frame=2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameters look strange for data that contains only 2 files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
_AuthApi_ | **auth_create_login** | **POST** /api/auth/login | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you want to support the table manually. It should be a reference that is generated automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but it is another big task.
```python | ||
from cvat_sdk.api_client import ApiClient, apis | ||
|
||
api_client = ApiClient(...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that we should describe all possible ways to use cvat_sdk.api_client. We need to show in the documentation only the recommended way.
user_model = models.User(...) | ||
``` | ||
|
||
- About |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any value in the list of strings. It should be a generated reference documenation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge as is and fix comments (if you agree) in next PRs.
/check |
✔️ All checks completed successfully |
Motivation and context
develop
branch in the docsapi/docs
,api/swagger
,api/schema
endpoints--insecure
env var to control host checks in CLIbuild_docs.py
(backported Make various improvements to site/build_docs.py openvinotoolkit/datumaro#589)How has this been tested?
Checklist
develop
branchcvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.