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

Merge annotations and dataset_manager apps #1352

Merged
merged 88 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
9c87cdc
Move annotations to dm
zhiltsov-max Mar 30, 2020
06d6217
Refactor dm
zhiltsov-max Mar 30, 2020
40375f0
Rename data manager
zhiltsov-max Mar 31, 2020
8c64a9a
Move anno dump and upload functions
zhiltsov-max Mar 31, 2020
ce9c0a8
Join server host and port in cvat cli
zhiltsov-max Apr 2, 2020
cf181ae
Move export templates dir
zhiltsov-max Apr 3, 2020
76c48c7
add dm project exporter
zhiltsov-max Apr 3, 2020
a2f00f5
update mask format support
zhiltsov-max Apr 3, 2020
37a4a03
Use decorators for formats definition
zhiltsov-max Apr 3, 2020
7736039
Update formats
zhiltsov-max Apr 3, 2020
ba75d7c
Update format implementations
zhiltsov-max Apr 6, 2020
8b0173a
remove parameter
zhiltsov-max Apr 6, 2020
5c770b4
Add dm views
zhiltsov-max Apr 6, 2020
527123b
Move annotation components to dm
zhiltsov-max Apr 6, 2020
a758550
restore extension for export formats
zhiltsov-max Apr 7, 2020
81404b1
update rest api
zhiltsov-max Apr 7, 2020
92b1bba
use serializers, update views
zhiltsov-max Apr 7, 2020
ae7974e
merge develop
zhiltsov-max Apr 7, 2020
f8e2663
Update format names
zhiltsov-max Apr 9, 2020
927ca56
Update docs
zhiltsov-max Apr 9, 2020
cc04df1
Update tests
zhiltsov-max Apr 9, 2020
2d2ca2d
move test
zhiltsov-max Apr 9, 2020
0263a0e
fix import
zhiltsov-max Apr 9, 2020
ec52ecd
Extend format tests
zhiltsov-max Apr 9, 2020
76f496e
django compatibility for directory access
zhiltsov-max Apr 9, 2020
1f4612c
move tests
zhiltsov-max Apr 9, 2020
e139e98
update module links
zhiltsov-max Apr 9, 2020
acf79ca
fixes
zhiltsov-max Apr 9, 2020
c3d8ed1
fix git application
zhiltsov-max Apr 10, 2020
5567e54
fixes
zhiltsov-max Apr 10, 2020
c46769f
add extension recommentation
zhiltsov-max Apr 10, 2020
8ef19aa
fixes
zhiltsov-max Apr 13, 2020
1c42d41
api
zhiltsov-max Apr 13, 2020
780e108
join api methods
zhiltsov-max Apr 13, 2020
951bcb4
Add trim whitespace to workspace config
zhiltsov-max Apr 14, 2020
3c5caae
update tests
zhiltsov-max Apr 14, 2020
fce56ca
fixes
zhiltsov-max Apr 14, 2020
c87ece3
Update format docs
zhiltsov-max Apr 14, 2020
1e5f992
join format queries
zhiltsov-max Apr 15, 2020
73edf83
fixes
zhiltsov-max Apr 15, 2020
1915bb7
update new ui
zhiltsov-max Apr 15, 2020
d7ff4de
ui tests
zhiltsov-max Apr 15, 2020
01e176d
old ui
zhiltsov-max Apr 15, 2020
f14571f
update js bundles
zhiltsov-max Apr 15, 2020
fb1c177
linter fixes
zhiltsov-max Apr 15, 2020
7b1e758
add image with loader tests
zhiltsov-max Apr 15, 2020
5111148
fix linter
zhiltsov-max Apr 15, 2020
a94cc5e
fix frame step and frame access
zhiltsov-max Apr 16, 2020
fa0ac2a
use server file name for annotations export
zhiltsov-max Apr 16, 2020
daea029
update cvat core
zhiltsov-max Apr 16, 2020
9fa1957
add import hack for rest api tests
zhiltsov-max Apr 17, 2020
ff07d8c
move cli tests
zhiltsov-max Apr 17, 2020
1edd1ab
fix cvat format converter args parsing
zhiltsov-max Apr 17, 2020
d7bc832
remove folder on extract error
zhiltsov-max Apr 17, 2020
4f88440
print error message on incorrect xpath expression
zhiltsov-max Apr 17, 2020
1ace725
use own categories when no others exist
zhiltsov-max Apr 17, 2020
ca2384a
update changelog
zhiltsov-max Apr 17, 2020
6a244cf
Merge branch 'develop' into zm/merge-anno-and-dm-2
zhiltsov-max Apr 17, 2020
51581b7
really add text to changelog
zhiltsov-max Apr 17, 2020
c87bf6b
Merge branch 'zm/merge-anno-and-dm-2' of https://github.com/opencv/cv…
zhiltsov-max Apr 17, 2020
d991f11
Fix annotation window menu
zhiltsov-max Apr 20, 2020
7595119
fix ui
zhiltsov-max Apr 24, 2020
6b29167
fix replace
zhiltsov-max Apr 24, 2020
5cbdb3e
update extra apps
zhiltsov-max Apr 24, 2020
d69c0a4
format readme
zhiltsov-max Apr 24, 2020
5ad4b09
readme
zhiltsov-max Apr 24, 2020
0d36cc3
Merge remote-tracking branch 'origin/develop' into zm/merge-anno-and-…
zhiltsov-max Apr 24, 2020
cdb26c1
linter
zhiltsov-max Apr 24, 2020
0ca795e
Merge branch 'develop' into zm/merge-anno-and-dm-2
zhiltsov-max Apr 27, 2020
3ad5e25
Fix old ui
zhiltsov-max Apr 27, 2020
10a00e9
Update CHANGELOG.md
nmanovic Apr 27, 2020
61b7740
Merge branch 'develop' into zm/merge-anno-and-dm-2
zhiltsov-max Apr 27, 2020
6bf194b
update user guide
zhiltsov-max Apr 27, 2020
fd41e1d
linter
zhiltsov-max Apr 27, 2020
28d3e52
more linter fixes
zhiltsov-max Apr 27, 2020
d1db65f
Merge branch 'develop' into zm/merge-anno-and-dm-2
zhiltsov-max May 6, 2020
95c7068
Update changelog
zhiltsov-max May 6, 2020
4b8016a
Merge remote-tracking branch 'origin/develop' into zm/merge-anno-and-…
zhiltsov-max May 6, 2020
1d4cb1f
fix merge
zhiltsov-max May 6, 2020
95180eb
Merge branch 'develop' into zm/merge-anno-and-dm-2
zhiltsov-max May 7, 2020
8d3b0ae
remove duplicating lines from changelog
zhiltsov-max May 7, 2020
13ea752
fix ci tests
zhiltsov-max May 7, 2020
c9dfff4
revert unnecessary changes in user_guide
zhiltsov-max May 7, 2020
5728cfd
revert changes in js libraries
zhiltsov-max May 7, 2020
80e04c6
rebuild cvat-core
zhiltsov-max May 7, 2020
9d32c57
fix uploading in old ui
zhiltsov-max May 7, 2020
79e7e9f
fix cvat xml uploading
zhiltsov-max May 7, 2020
ae7c237
Bump cvat-core and cvat-ui versions
zhiltsov-max May 8, 2020
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
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ before_script:
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml build

script:
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'python3 manage.py test cvat/apps utils/cli'
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'python3 manage.py test --pattern="_tests.py" cvat/apps/dataset_manager'
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'python3 manage.py test cvat/apps'
# FIXME: Git package and application name conflict in PATH
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'python3 manage.py test --pattern="_test*.py" cvat/apps/engine/tests cvat/apps/dataset_manager/tests utils/cli'
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'python3 manage.py test datumaro/'
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'cd cvat-data && npm install && cd ../cvat-core && npm install && npm run test && npm run coveralls'
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
"./datumaro",
],
"licenser.license": "Custom",
"licenser.customHeader": "Copyright (C) @YEAR@ Intel Corporation\n\nSPDX-License-Identifier: MIT"
"licenser.customHeader": "Copyright (C) @YEAR@ Intel Corporation\n\nSPDX-License-Identifier: MIT",
"files.trimTrailingWhitespace": true
}
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [1.0.0-beta.2] - Unreleased
### Added
- Added `datumaro_project` export format (https://github.com/opencv/cvat/pull/1352)
- Re-Identification algorithm to merging bounding boxes automatically to the new UI (https://github.com/opencv/cvat/pull/1406)
- Methods ``import`` and ``export`` to import/export raw annotations for Job and Task in ``cvat-core`` (https://github.com/opencv/cvat/pull/1406)

### Changed
-
- Downloaded file name in annotations export became more informative (https://github.com/opencv/cvat/pull/1352)
- Added auto trimming for trailing whitespaces style enforsement (https://github.com/opencv/cvat/pull/1352)
- REST API: updated `GET /task/<id>/annotations`: parameters are `format`, `filename` (now optional), `action` (optional) (https://github.com/opencv/cvat/pull/1352)
- REST API: removed `dataset/formats`, changed format of `annotation/formats` (https://github.com/opencv/cvat/pull/1352)
- Exported annotations are stored for N hours insted of indefinitely (https://github.com/opencv/cvat/pull/1352)
nmanovic marked this conversation as resolved.
Show resolved Hide resolved
- Formats: CVAT format now accepts ZIP and XML (https://github.com/opencv/cvat/pull/1352)
- Formats: COCO format now accepts ZIP and JSON (https://github.com/opencv/cvat/pull/1352)
- Formats: most of formats renamed, no extension in title (https://github.com/opencv/cvat/pull/1352)
- Formats: definitions are changed, are not stored in DB anymore (https://github.com/opencv/cvat/pull/1352)

### Deprecated
-

### Removed
-
- `annotation` application is replaced with `dataset_manager` (https://github.com/opencv/cvat/pull/1352)

### Fixed
- Categories for empty projects with no sources are taken from own dataset (https://github.com/opencv/cvat/pull/1352)
- Added directory removal on error during `extract` command (https://github.com/opencv/cvat/pull/1352)
- Added debug error message on incorrect XPath (https://github.com/opencv/cvat/pull/1352)
- Exporting frame stepped task (https://github.com/opencv/cvat/issues/1294, https://github.com/opencv/cvat/issues/1334)
- Auto annotation, TF annotation and Auto segmentation apps (https://github.com/opencv/cvat/pull/1409)

### Security
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ for development
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [vscode-remark-lint](https://marketplace.visualstudio.com/items?itemName=drewbourne.vscode-remark-lint)
- [licenser](https://marketplace.visualstudio.com/items?itemName=ymotongpoo.licenser)
- [Trailing Spaces](https://marketplace.visualstudio.com/items?itemName=shardulm94.trailing-spaces)

- Reload Visual Studio Code from virtual environment

Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,22 @@ CVAT is free, online, interactive video and image annotation tool for computer v

## Supported annotation formats

Format selection is possible after clicking on the Upload annotation / Dump annotation button.
Format selection is possible after clicking on the Upload annotation and Dump annotation buttons.
[Datumaro](datumaro/README.md) dataset framework allows additional dataset transformations
via its command line tool.
via its command line tool and Python library.

| Annotation format | Dumper | Loader |
| Annotation format | Import | Export |
| ------------------------------------------------------------------------------------------ | ------ | ------ |
| [CVAT XML v1.1 for images](cvat/apps/documentation/xml_format.md#annotation) | X | X |
| [CVAT XML v1.1 for a video](cvat/apps/documentation/xml_format.md#interpolation) | X | X |
| [Pascal VOC](http://host.robots.ox.ac.uk/pascal/VOC/) | X | X |
| [CVAT for images](cvat/apps/documentation/xml_format.md#annotation) | X | X |
| [CVAT for a video](cvat/apps/documentation/xml_format.md#interpolation) | X | X |
| [Datumaro](datumaro/README.md) | | X |
| [PASCAL VOC](http://host.robots.ox.ac.uk/pascal/VOC/) | X | X |
| Segmentation masks from [PASCAL VOC](http://host.robots.ox.ac.uk/pascal/VOC/) | X | X |
| [YOLO](https://pjreddie.com/darknet/yolo/) | X | X |
| [MS COCO Object Detection](http://cocodataset.org/#format-data) | X | X |
| PNG class mask + instance mask as in [Pascal VOC](http://host.robots.ox.ac.uk/pascal/VOC/) | X | X |
| [TFrecord](https://www.tensorflow.org/tutorials/load_data/tf_records) | X | X |
| [MOT](https://motchallenge.net/) | X | X |
| [LabelMe](http://labelme.csail.mit.edu/Release3.0) | X | X |
| [LabelMe 3.0](http://labelme.csail.mit.edu/Release3.0) | X | X |

## Links
- [Intel AI blog: New Computer Vision Tool Accelerates Annotation of Digital Images and Video](https://www.intel.ai/introducing-cvat)
Expand Down
117 changes: 14 additions & 103 deletions cvat-core/src/annotation-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
class Loader {
constructor(initialData) {
const data = {
display_name: initialData.display_name,
format: initialData.format,
handler: initialData.handler,
name: initialData.name,
format: initialData.ext,
version: initialData.version,
};

Expand All @@ -27,7 +26,7 @@
* @readonly
* @instance
*/
get: () => data.display_name,
get: () => data.name,
},
format: {
/**
Expand All @@ -39,16 +38,6 @@
*/
get: () => data.format,
},
handler: {
/**
* @name handler
* @type {string}
* @memberof module:API.cvat.classes.Loader
* @readonly
* @instance
*/
get: () => data.handler,
},
version: {
/**
* @name version
Expand All @@ -71,9 +60,8 @@
class Dumper {
constructor(initialData) {
const data = {
display_name: initialData.display_name,
format: initialData.format,
handler: initialData.handler,
name: initialData.name,
format: initialData.ext,
version: initialData.version,
};

Expand All @@ -86,7 +74,7 @@
* @readonly
* @instance
*/
get: () => data.display_name,
get: () => data.name,
},
format: {
/**
Expand All @@ -98,16 +86,6 @@
*/
get: () => data.format,
},
handler: {
/**
* @name handler
* @type {string}
* @memberof module:API.cvat.classes.Dumper
* @readonly
* @instance
*/
get: () => data.handler,
},
version: {
/**
* @name version
Expand All @@ -127,108 +105,41 @@
* @memberof module:API.cvat.classes
* @hideconstructor
*/
class AnnotationFormat {
class AnnotationFormats {
zhiltsov-max marked this conversation as resolved.
Show resolved Hide resolved
constructor(initialData) {
const data = {
created_date: initialData.created_date,
updated_date: initialData.updated_date,
id: initialData.id,
owner: initialData.owner,
name: initialData.name,
handler_file: initialData.handler_file,
exporters: initialData.exporters.map((el) => new Dumper(el)),
importers: initialData.importers.map((el) => new Loader(el)),
};

data.dumpers = initialData.dumpers.map((el) => new Dumper(el));
data.loaders = initialData.loaders.map((el) => new Loader(el));

// Now all fields are readonly
Object.defineProperties(this, {
id: {
/**
* @name id
* @type {integer}
* @memberof module:API.cvat.classes.AnnotationFormat
* @readonly
* @instance
*/
get: () => data.id,
},
owner: {
/**
* @name owner
* @type {integer}
* @memberof module:API.cvat.classes.AnnotationFormat
* @readonly
* @instance
*/
get: () => data.owner,
},
name: {
/**
* @name name
* @type {string}
* @memberof module:API.cvat.classes.AnnotationFormat
* @readonly
* @instance
*/
get: () => data.name,
},
createdDate: {
/**
* @name createdDate
* @type {string}
* @memberof module:API.cvat.classes.AnnotationFormat
* @readonly
* @instance
*/
get: () => data.created_date,
},
updatedDate: {
/**
* @name updatedDate
* @type {string}
* @memberof module:API.cvat.classes.AnnotationFormat
* @readonly
* @instance
*/
get: () => data.updated_date,
},
handlerFile: {
/**
* @name handlerFile
* @type {string}
* @memberof module:API.cvat.classes.AnnotationFormat
* @readonly
* @instance
*/
get: () => data.handler_file,
},
loaders: {
/**
* @name loaders
* @type {module:API.cvat.classes.Loader[]}
* @memberof module:API.cvat.classes.AnnotationFormat
* @memberof module:API.cvat.classes.AnnotationFormats
* @readonly
* @instance
*/
get: () => [...data.loaders],
get: () => [...data.importers],
},
dumpers: {
/**
* @name dumpers
* @type {module:API.cvat.classes.Dumper[]}
* @memberof module:API.cvat.classes.AnnotationFormat
* @memberof module:API.cvat.classes.AnnotationFormats
* @readonly
* @instance
*/
get: () => [...data.dumpers],
get: () => [...data.exporters],
},
});
}
}

module.exports = {
AnnotationFormat,
AnnotationFormats,
Loader,
Dumper,
};
Expand Down
9 changes: 2 additions & 7 deletions cvat-core/src/api-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
} = require('./enums');

const User = require('./user');
const { AnnotationFormat } = require('./annotation-format.js');
const { AnnotationFormats } = require('./annotation-format.js');
const { ArgumentError } = require('./exceptions');
const { Task } = require('./session');

Expand Down Expand Up @@ -66,12 +66,7 @@

cvat.server.formats.implementation = async () => {
const result = await serverProxy.server.formats();
return result.map((el) => new AnnotationFormat(el));
};

cvat.server.datasetFormats.implementation = async () => {
const result = await serverProxy.server.datasetFormats();
return result;
return new AnnotationFormats(result);
};

cvat.server.register.implementation = async (username, firstName, lastName,
Expand Down
16 changes: 1 addition & 15 deletions cvat-core/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function build() {
* @method formats
* @async
* @memberof module:API.cvat.server
* @returns {module:API.cvat.classes.AnnotationFormat[]}
* @returns {module:API.cvat.classes.AnnotationFormats}
* @throws {module:API.cvat.exceptions.PluginError}
* @throws {module:API.cvat.exceptions.ServerError}
*/
Expand All @@ -118,20 +118,6 @@ function build() {
.apiWrapper(cvat.server.formats);
return result;
},
/**
* Method returns available dataset export formats
* @method exportFormats
* @async
* @memberof module:API.cvat.server
* @returns {module:String[]}
* @throws {module:API.cvat.exceptions.PluginError}
* @throws {module:API.cvat.exceptions.ServerError}
*/
async datasetFormats() {
const result = await PluginRegistry
.apiWrapper(cvat.server.datasetFormats);
return result;
},
/**
* Method allows to register on a server
* @method register
Expand Down
22 changes: 4 additions & 18 deletions cvat-core/src/server-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,22 +154,6 @@
return response.data;
}

async function datasetFormats() {
const { backendAPI } = config;

let response = null;
try {
response = await Axios.get(`${backendAPI}/server/dataset/formats`, {
proxy: config.proxy,
});
response = JSON.parse(response.data);
} catch (errorData) {
throw generateError(errorData);
}

return response;
}

async function register(username, firstName, lastName, email, password1, password2) {
let response = null;
try {
Expand Down Expand Up @@ -618,8 +602,11 @@
async function dumpAnnotations(id, name, format) {
const { backendAPI } = config;
const filename = name.replace(/\//g, '_');
const baseURL = `${backendAPI}/tasks/${id}/annotations/${encodeURIComponent(filename)}`;
const baseURL = `${backendAPI}/tasks/${id}/annotations`;
let query = `format=${encodeURIComponent(format)}`;
if (name) {
query += `&filename=${encodeURIComponent(filename)}`;
}
let url = `${baseURL}?${query}`;

return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -664,7 +651,6 @@
about,
share,
formats,
datasetFormats,
exception,
login,
logout,
Expand Down
Loading