-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[Datumaro] CLI updates #1057
Merged
Merged
[Datumaro] CLI updates #1057
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
c475eac
CLI updates
zhiltsov-max 1ebad0e
Add project command descriptions, add default dir for project export,…
zhiltsov-max 6f27dd3
Replace test comparison with more safe
zhiltsov-max 4d102a4
Add help to CLI
zhiltsov-max ac9de57
Update CLI and readme
zhiltsov-max 8ce2e74
CLI and docs
zhiltsov-max 79e126f
Add license headers
zhiltsov-max 3a6d9df
Add images dir extractor
zhiltsov-max 4f6e938
Add images dir extractor
zhiltsov-max 305a98b
Update docs
zhiltsov-max acf356d
Move import command to the top, reposition source add args
zhiltsov-max b1b6fb2
Fix datum command invocation
zhiltsov-max ded5c4b
Update license headers
zhiltsov-max 5d95230
Add contribution guide
zhiltsov-max c062f0f
Add cvat format spec link, fix invocation
zhiltsov-max f9d490d
Update cli diagram
zhiltsov-max 9632e14
Fix cvat dataset export
zhiltsov-max 2538233
Update docs
zhiltsov-max fb727e2
Fix filter invocation, add mode shortcuts
zhiltsov-max 0f01c9b
Fix source remove
zhiltsov-max 173d819
Add undestandable error when different categories
zhiltsov-max dfe1f2f
Rename coco and images_dir
zhiltsov-max b67a018
Merge branch 'develop' into zm/dm-cli-and-docs-update
zhiltsov-max 474324a
Make source format parameter mandatory
zhiltsov-max 192b20e
Merge branch 'zm/dm-cli-and-docs-update' of https://github.com/opencv…
zhiltsov-max d79d655
Fix image comparison
zhiltsov-max 3d09d53
Fix linter
zhiltsov-max 0532b49
Reference datumaro in CVAT readme
zhiltsov-max 043570f
Enable datumaro unit tests in cvat vscode env
zhiltsov-max dc4c016
Enable datumaro unit tests in cvat vscode env
zhiltsov-max 70beb52
Add project info command
zhiltsov-max c949463
Update CLI image
zhiltsov-max c349147
Update docs
zhiltsov-max ae21e71
Add missing section to usage
zhiltsov-max f01033e
Move installation and usage to the top
zhiltsov-max 3ac7d15
linter
zhiltsov-max 752c45e
Fix voc loading
zhiltsov-max 27e22d5
Add type conversions for attributes
zhiltsov-max 19cd409
Add attr type conversions to the cvat format
zhiltsov-max 0fe74d0
Make attribute use in converters more careful
zhiltsov-max 4d779ba
Fixes, hide transform
zhiltsov-max ee7874e
Add complex filter example
zhiltsov-max 27543a5
Source add usage fix
zhiltsov-max a30bcf0
linter
zhiltsov-max c7b73e9
Add more rich test output
zhiltsov-max 1cc9e19
Complete voc examples
zhiltsov-max 6f1c3c4
Regularize directory logic across cli
zhiltsov-max 77155a4
Describe link
zhiltsov-max 4f12c3c
Update filter test
zhiltsov-max 13ee23f
Fix failing cvat test
zhiltsov-max File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
## Table of Contents | ||
|
||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Testing](#testing) | ||
- [Design](#design-and-code-structure) | ||
|
||
## Installation | ||
|
||
### Prerequisites | ||
|
||
- Python (3.5+) | ||
- OpenVINO (optional) | ||
|
||
``` bash | ||
git clone https://github.com/opencv/cvat | ||
``` | ||
|
||
Optionally, install a virtual environment: | ||
|
||
``` bash | ||
python -m pip install virtualenv | ||
python -m virtualenv venv | ||
. venv/bin/activate | ||
``` | ||
|
||
Then install all dependencies: | ||
|
||
``` bash | ||
while read -r p; do pip install $p; done < requirements.txt | ||
``` | ||
|
||
If you're working inside CVAT environment: | ||
``` bash | ||
. .env/bin/activate | ||
while read -r p; do pip install $p; done < datumaro/requirements.txt | ||
``` | ||
|
||
## Usage | ||
|
||
> The directory containing Datumaro should be in the `PYTHONPATH` | ||
> environment variable or `cvat/datumaro/` should be the current directory. | ||
|
||
``` bash | ||
datum --help | ||
python -m datumaro --help | ||
python datumaro/ --help | ||
python datum.py --help | ||
``` | ||
|
||
``` python | ||
import datumaro | ||
``` | ||
|
||
## Testing | ||
|
||
It is expected that all Datumaro functionality is covered and checked by | ||
unit tests. Tests are placed in `tests/` directory. | ||
|
||
To run tests use: | ||
|
||
``` bash | ||
python -m unittest discover -s tests | ||
``` | ||
|
||
If you're working inside CVAT environment, you can also use: | ||
|
||
``` bash | ||
python manage.py test datumaro/ | ||
``` | ||
|
||
## Design and code structure | ||
|
||
- [Design document](docs/design.md) | ||
|
||
### Command-line | ||
|
||
Use [Docker](https://www.docker.com/) as an example. Basically, | ||
the interface is divided on contexts and single commands. | ||
Contexts are semantically grouped commands, | ||
related to a single topic or target. Single commands are handy shorter | ||
alternatives for the most used commands and also special commands, | ||
which are hard to be put into any specific context. | ||
|
||
![cli-design-image](docs/images/cli_design.png) | ||
|
||
- The diagram above was created with [FreeMind](http://freemind.sourceforge.net/wiki/index.php/Main_Page) | ||
|
||
Model-View-ViewModel (MVVM) UI pattern is used. | ||
|
||
![mvvm-image](docs/images/mvvm.png) | ||
|
||
### Datumaro project and environment structure | ||
|
||
<!--lint disable fenced-code-flag--> | ||
``` | ||
├── [datumaro module] | ||
└── [project folder] | ||
├── .datumaro/ | ||
| ├── config.yml | ||
│ ├── .git/ | ||
│ ├── importers/ | ||
│ │ ├── custom_format_importer1.py | ||
│ │ └── ... | ||
│ ├── statistics/ | ||
│ │ ├── custom_statistic1.py | ||
│ │ └── ... | ||
│ ├── visualizers/ | ||
│ │ ├── custom_visualizer1.py | ||
│ │ └── ... | ||
│ └── extractors/ | ||
│ ├── custom_extractor1.py | ||
│ └── ... | ||
├── dataset/ | ||
└── sources/ | ||
├── source1 | ||
└── ... | ||
``` | ||
<!--lint enable fenced-code-flag--> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 project structure doesn't correspond to the current state. I'm OK if we fix the actual project structure later.