From a50b4cc1449144f3c7da331aae6e849318af3bf3 Mon Sep 17 00:00:00 2001 From: Nikita Manovich Date: Thu, 30 Aug 2018 14:22:45 +0300 Subject: [PATCH] Moved development on public github. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - changed Content-type for save_job request to application/json, object… - Adopted public PR - PASCAL VOC converter - Added convert_to_mask.py script - Fixed player continue plaing at the end of video, lock for editable object broke the client - Same colors for shapes and menus, ability to change color for label or group - Undo redo - Added license header for all files - Added .gitattributes file (critical for bash scripts) - Fixed "Don't delete tasks if a user is deleted" - More strict check for 'checkbox' and 'number' values - Added convert_to_coco.py script - Job statistic were extended. Blowradius was removed - More strict labels verification - Drag polygons by requirement, norm stroke opacity, easy box dragging - Drawing with mouse outside the image area - Fixed 7z support - Boundig box size in drawer, switcheable grid - Split tracks feature - Fix flip parsing - Update color set & color by label feature - Add point for polygons feature - Added context menu - Polyshapes --- .gitattributes | 29 + CONTRIBUTING.md | 49 - CONTRIBUTORS.md | 11 +- Dockerfile | 1 + LICENSE | 40 +- README.md | 26 +- cvat/__init__.py | 5 + cvat/apps/authentication/__init__.py | 6 + cvat/apps/authentication/admin.py | 6 + cvat/apps/authentication/apps.py | 5 + cvat/apps/authentication/decorators.py | 5 + cvat/apps/authentication/forms.py | 5 + .../authentication/migrations/__init__.py | 5 + cvat/apps/authentication/models.py | 6 + cvat/apps/authentication/settings/__init__.py | 5 + .../apps/authentication/settings/auth_ldap.py | 5 + .../authentication/settings/auth_simple.py | 6 + .../authentication/settings/authentication.py | 5 + cvat/apps/authentication/signals.py | 5 + cvat/apps/authentication/templates/403.html | 5 + cvat/apps/authentication/templates/login.html | 5 + .../authentication/templates/login_ldap.html | 5 + cvat/apps/authentication/templates/note.html | 5 + .../authentication/templates/register.html | 5 + .../templates/user_profile.html | 5 + cvat/apps/authentication/tests.py | 6 + cvat/apps/authentication/urls.py | 5 + cvat/apps/authentication/views.py | 5 + cvat/apps/dashboard/__init__.py | 5 + cvat/apps/dashboard/admin.py | 6 + cvat/apps/dashboard/apps.py | 6 + cvat/apps/dashboard/migrations/__init__.py | 5 + cvat/apps/dashboard/models.py | 6 + .../static/dashboard/js/dashboard.js | 102 +- .../dashboard/static/dashboard/stylesheet.css | 6 + .../templates/dashboard/dashboard.html | 22 +- .../dashboard/templates/dashboard/task.html | 5 + cvat/apps/dashboard/tests.py | 6 + cvat/apps/dashboard/urls.py | 6 + cvat/apps/dashboard/views.py | 6 + cvat/apps/documentation/__init__.py | 6 + cvat/apps/documentation/admin.py | 6 + cvat/apps/documentation/apps.py | 6 + .../apps/documentation/migrations/__init__.py | 5 + cvat/apps/documentation/models.py | 6 + .../documentation/js/3rdparty/showdown.js | 88 +- .../static/documentation/js/shortcuts.js | 8 +- .../templates/documentation/base_page.html | 5 + .../templates/documentation/user_guide.html | 5 + .../templates/documentation/xml_format.html | 5 + cvat/apps/documentation/tests.py | 6 + cvat/apps/documentation/urls.py | 6 + cvat/apps/documentation/views.py | 5 + cvat/apps/engine/__init__.py | 5 + cvat/apps/engine/admin.py | 6 + cvat/apps/engine/annotation.py | 1343 ++- cvat/apps/engine/apps.py | 6 + cvat/apps/engine/logging.py | 5 + .../engine/migrations/0001_release_v0_1_0.py | 5 + ...dpolygonattributeval_labeledpolyline_la.py | 175 + .../migrations/0003_objectpath_shapes.py | 23 + .../engine/migrations/0004_task_z_order.py | 23 + .../migrations/0005_auto_20180609_1512.py | 58 + .../migrations/0006_auto_20180629_1501.py | 43 + .../engine/migrations/0007_task_flipped.py | 23 + cvat/apps/engine/migrations/__init__.py | 5 + cvat/apps/engine/models.py | 89 +- cvat/apps/engine/static/engine/base.css | 40 +- cvat/apps/engine/static/engine/icons/copy.png | Bin 0 -> 254 bytes .../static/engine/icons/hidden-shape.png | Bin 0 -> 532 bytes .../static/engine/icons/hidden-text.png | Bin 0 -> 690 bytes .../static/engine/icons/initKeyFrame.png | Bin 0 -> 668 bytes .../static/engine/icons/nextKeyFrame.png | Bin 0 -> 657 bytes .../engine/static/engine/icons/non-hidden.png | Bin 0 -> 634 bytes .../static/engine/icons/prevKeyFrame.png | Bin 0 -> 673 bytes .../engine/static/engine/icons/propagate.png | Bin 0 -> 409 bytes .../engine/static/engine/js/3rdparty.patch | 117 + .../static/engine/js/3rdparty/interact.js | 7172 ----------------- .../engine/js/3rdparty/jquery.fullscreen.js | 184 + .../engine/static/engine/js/3rdparty/md5.js | 280 + .../static/engine/js/3rdparty/object_hash.js | 3 - .../engine/js/3rdparty/svg.draggable.js | 227 + .../static/engine/js/3rdparty/svg.draw.js | 442 + .../engine/static/engine/js/3rdparty/svg.js | 5598 +++++++++++++ .../static/engine/js/3rdparty/svg.resize.js | 454 ++ .../static/engine/js/3rdparty/svg.select.js | 417 + .../static/engine/js/annotationParser.js | 473 +- .../engine/static/engine/js/annotationUI.js | 857 +- cvat/apps/engine/static/engine/js/api.js | 22 - .../engine/js/attributeAnnotationMode.js | 626 +- cvat/apps/engine/static/engine/js/base.js | 25 +- .../apps/engine/static/engine/js/bootstrap.js | 13 +- .../engine/static/engine/js/checkPlatform.js | 10 +- .../static/engine/js/collectionController.js | 213 - .../static/engine/js/collectionModel.js | 437 - .../engine/static/engine/js/collectionView.js | 140 - cvat/apps/engine/static/engine/js/drawer.js | 285 - cvat/apps/engine/static/engine/js/history.js | 207 + .../engine/static/engine/js/labelsInfo.js | 22 +- cvat/apps/engine/static/engine/js/listener.js | 6 + cvat/apps/engine/static/engine/js/logger.js | 29 +- cvat/apps/engine/static/engine/js/merger.js | 331 - cvat/apps/engine/static/engine/js/player.js | 240 +- .../engine/static/engine/js/qunitTests.js | 720 +- cvat/apps/engine/static/engine/js/server.js | 18 +- .../engine/static/engine/js/shapeBuffer.js | 495 +- .../static/engine/js/shapeCollection.js | 1331 +++ .../engine/static/engine/js/shapeCreator.js | 535 ++ .../engine/static/engine/js/shapeFilter.js | 134 + .../engine/static/engine/js/shapeGrouper.js | 273 + .../engine/static/engine/js/shapeMerger.js | 280 + .../engine/static/engine/js/shapeSplitter.js | 74 + cvat/apps/engine/static/engine/js/shapes.js | 3152 ++++++++ .../static/engine/js/trackController.js | 24 - .../engine/static/engine/js/trackFilter.js | 167 - .../engine/static/engine/js/trackModel.js | 739 -- .../apps/engine/static/engine/js/trackView.js | 825 -- .../engine/static/engine/js/userConfig.js | 174 +- cvat/apps/engine/static/engine/stylesheet.css | 275 +- cvat/apps/engine/task.py | 472 +- .../engine/templates/engine/annotation.html | 294 +- cvat/apps/engine/templates/engine/base.html | 5 + cvat/apps/engine/tests.py | 6 + cvat/apps/engine/urls.py | 5 + cvat/apps/engine/views.py | 7 +- cvat/apps/log_proxy/__init__.py | 5 + cvat/apps/log_proxy/admin.py | 6 + cvat/apps/log_proxy/apps.py | 6 + cvat/apps/log_proxy/migrations/__init__.py | 5 + cvat/apps/log_proxy/models.py | 6 + cvat/apps/log_proxy/proxy_logger.py | 5 + cvat/apps/log_proxy/tests.py | 6 + cvat/apps/log_proxy/urls.py | 6 + cvat/apps/log_proxy/views.py | 5 + cvat/apps/tf_annotation/__init__.py | 6 + cvat/apps/tf_annotation/admin.py | 6 + cvat/apps/tf_annotation/apps.py | 6 + .../docker_setup_tf_annotation.sh | 5 + .../apps/tf_annotation/migrations/__init__.py | 5 + cvat/apps/tf_annotation/models.py | 6 + .../static/tf_annotation/js/tf_annotation.js | 6 + cvat/apps/tf_annotation/tests.py | 6 + cvat/apps/tf_annotation/urls.py | 7 +- cvat/apps/tf_annotation/views.py | 15 +- cvat/requirements/base.txt | 2 +- cvat/requirements/development.txt | 2 +- cvat/settings/__init__.py | 5 + cvat/settings/base.py | 8 +- cvat/settings/development.py | 5 + cvat/settings/production.py | 5 + cvat/settings/staging.py | 7 +- cvat/simpleworker.py | 5 + cvat/urls.py | 5 + cvat/utils/convert_to_voc.py | 80 - cvat/utils/requirements.txt | 1 - cvat/wsgi.py | 5 + docker-compose.nvidia.yml | 5 + docker-compose.yml | 6 +- manage.py | 5 + tests/eslintrc.conf.js | 81 +- tests/karma.conf.js | 12 +- tests/run_js_linter.sh | 7 +- utils/README.md | 9 + {cvat/utils => utils}/__init__.py | 0 {cvat/utils/tests => utils/coco}/__init__.py | 0 utils/coco/converter.md | 38 + utils/coco/converter.py | 420 + utils/coco/requirements.txt | 11 + utils/mask/__init__.py | 0 utils/mask/converter.md | 42 + utils/mask/converter.py | 117 + utils/mask/requirements.txt | 9 + utils/voc/__init__.py | 0 utils/voc/converter.md | 30 + utils/voc/converter.py | 99 + utils/voc/requirements.txt | 4 + utils/voc/tests/__init__.py | 0 .../voc}/tests/test_process_cvat_xml.py | 29 +- 178 files changed, 19643 insertions(+), 12822 deletions(-) create mode 100644 .gitattributes create mode 100644 cvat/apps/engine/migrations/0002_labeledpoints_labeledpointsattributeval_labeledpolygon_labeledpolygonattributeval_labeledpolyline_la.py create mode 100644 cvat/apps/engine/migrations/0003_objectpath_shapes.py create mode 100644 cvat/apps/engine/migrations/0004_task_z_order.py create mode 100644 cvat/apps/engine/migrations/0005_auto_20180609_1512.py create mode 100644 cvat/apps/engine/migrations/0006_auto_20180629_1501.py create mode 100644 cvat/apps/engine/migrations/0007_task_flipped.py create mode 100644 cvat/apps/engine/static/engine/icons/copy.png create mode 100644 cvat/apps/engine/static/engine/icons/hidden-shape.png create mode 100644 cvat/apps/engine/static/engine/icons/hidden-text.png create mode 100644 cvat/apps/engine/static/engine/icons/initKeyFrame.png create mode 100644 cvat/apps/engine/static/engine/icons/nextKeyFrame.png create mode 100644 cvat/apps/engine/static/engine/icons/non-hidden.png create mode 100644 cvat/apps/engine/static/engine/icons/prevKeyFrame.png create mode 100644 cvat/apps/engine/static/engine/icons/propagate.png create mode 100644 cvat/apps/engine/static/engine/js/3rdparty.patch delete mode 100644 cvat/apps/engine/static/engine/js/3rdparty/interact.js create mode 100644 cvat/apps/engine/static/engine/js/3rdparty/jquery.fullscreen.js create mode 100644 cvat/apps/engine/static/engine/js/3rdparty/md5.js delete mode 100644 cvat/apps/engine/static/engine/js/3rdparty/object_hash.js create mode 100644 cvat/apps/engine/static/engine/js/3rdparty/svg.draggable.js create mode 100644 cvat/apps/engine/static/engine/js/3rdparty/svg.draw.js create mode 100644 cvat/apps/engine/static/engine/js/3rdparty/svg.js create mode 100644 cvat/apps/engine/static/engine/js/3rdparty/svg.resize.js create mode 100644 cvat/apps/engine/static/engine/js/3rdparty/svg.select.js delete mode 100644 cvat/apps/engine/static/engine/js/api.js delete mode 100644 cvat/apps/engine/static/engine/js/collectionController.js delete mode 100644 cvat/apps/engine/static/engine/js/collectionModel.js delete mode 100644 cvat/apps/engine/static/engine/js/collectionView.js delete mode 100644 cvat/apps/engine/static/engine/js/drawer.js create mode 100644 cvat/apps/engine/static/engine/js/history.js delete mode 100644 cvat/apps/engine/static/engine/js/merger.js create mode 100644 cvat/apps/engine/static/engine/js/shapeCollection.js create mode 100644 cvat/apps/engine/static/engine/js/shapeCreator.js create mode 100644 cvat/apps/engine/static/engine/js/shapeFilter.js create mode 100644 cvat/apps/engine/static/engine/js/shapeGrouper.js create mode 100644 cvat/apps/engine/static/engine/js/shapeMerger.js create mode 100644 cvat/apps/engine/static/engine/js/shapeSplitter.js create mode 100644 cvat/apps/engine/static/engine/js/shapes.js delete mode 100644 cvat/apps/engine/static/engine/js/trackController.js delete mode 100644 cvat/apps/engine/static/engine/js/trackFilter.js delete mode 100644 cvat/apps/engine/static/engine/js/trackModel.js delete mode 100644 cvat/apps/engine/static/engine/js/trackView.js delete mode 100644 cvat/utils/convert_to_voc.py delete mode 100644 cvat/utils/requirements.txt create mode 100644 utils/README.md rename {cvat/utils => utils}/__init__.py (100%) rename {cvat/utils/tests => utils/coco}/__init__.py (100%) create mode 100644 utils/coco/converter.md create mode 100644 utils/coco/converter.py create mode 100644 utils/coco/requirements.txt create mode 100644 utils/mask/__init__.py create mode 100644 utils/mask/converter.md create mode 100644 utils/mask/converter.py create mode 100644 utils/mask/requirements.txt create mode 100644 utils/voc/__init__.py create mode 100644 utils/voc/converter.md create mode 100644 utils/voc/converter.py create mode 100644 utils/voc/requirements.txt create mode 100644 utils/voc/tests/__init__.py rename {cvat/utils => utils/voc}/tests/test_process_cvat_xml.py (85%) diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..7c0b591b072c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,29 @@ +* text=auto whitespace=trailing-space,space-before-tab,-indent-with-non-tab,tab-in-indent,tabwidth=4 + +.git* text export-ignore + +*.txt text +*.htm text +*.html text +*.js text +*.py text +*.css text +*.md text +*.yml text +Dockerfile text +LICENSE text +*.conf text +*.mimetypes text +*.sh text eol=lf + +*.avi binary +*.bmp binary +*.exr binary +*.ico binary +*.jpeg binary +*.jpg binary +*.png binary +*.gif binary +*.ttf binary +*.pdf binary + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d3776747e461..356157809027 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,52 +2,3 @@ When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. - -## Development environment - -Next steps should work on clear Ubuntu 18.04. - -- Install necessary dependencies: - -```sh -$ sudo apt-get install -y curl redis-server python3-dev python3-pip python3-venv libldap2-dev libsasl2-dev -``` - -- Install [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux#_debian-and-ubuntu-based-distributions) for development - -- Install CVAT on your local host: - -```sh -$ git clone https://github.com/opencv/cvat -$ cd cvat && mkdir logs keys -$ python3 -m venv .env -$ . .env/bin/activate -$ pip install -U pip wheel -$ pip install -r cvat/requirements/development.txt -$ python manage.py migrate -$ python manage.py collectstatic -``` - -- Create a super user for CVAT: - -```sh -$ python manage.py createsuperuser -Username (leave blank to use 'django'): *** -Email address: *** -Password: *** -Password (again): *** -``` - -- Run Visual Studio Code from the virtual environment - -``` -$ code . -``` - -- Inside Visual Studio Code install [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) and [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) extensions - -- Reload Visual Studio Code - -- Select `CVAT Debugging` configuration and start debugging (F5) - -You have done! Now it is possible to insert breakpoints and debug server and client of the tool. \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c649d0b4b538..8f4fa1386724 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -10,7 +10,7 @@ * Primary developer * Author and maintainer -- **[Andrey Zhavoronkov]()** +- **[Andrey Zhavoronkov](https://github.com/azhavoro)** * Developer * Author and maintainer @@ -18,8 +18,13 @@ # Contributors - **[Victor Salimonov](https://github.com/VikTorSalimonov)** + * Documentation, screencasts +- **[Dmitry Sidnev](https://github.com/DmitriySidnev)** + + * [convert_to_coco.py](utils/coco) - an utility for converting annotation from CVAT to COCO data annotation format + - **[Sebastián Yonekura](https://github.com/syonekura)** - * [convert_to_voc.py](cvat/utils/convert_to_voc.py) - an utility for - converting CVAT XML to PASCAL VOC data annotation format. \ No newline at end of file + + * [convert_to_voc.py](utils/voc) - an utility for converting CVAT XML to PASCAL VOC data annotation format. diff --git a/Dockerfile b/Dockerfile index c86e3ae0306e..fe2952a8b9ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,6 +87,7 @@ COPY supervisord.conf mod_wsgi.conf wait-for-it.sh manage.py ${HOME}/ RUN pip3 install --no-cache-dir -r /tmp/requirements/${DJANGO_CONFIGURATION}.txt COPY cvat/ ${HOME}/cvat COPY tests ${HOME}/tests +RUN patch -p1 < ${HOME}/cvat/apps/engine/static/engine/js/3rdparty.patch RUN chown -R ${USER}:${USER} . # RUN all commands below as 'django' user diff --git a/LICENSE b/LICENSE index 97c8a762b6f7..aae0a08ec7db 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2018 annotation - +Copyright (C) 2018 Intel Corporation +  Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom +the Software is furnished to do so, subject to the following conditions: +  +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. +  +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. +  +SPDX-License-Identifier: MIT diff --git a/README.md b/README.md index 9ed6f778b89c..63f26ee7ed82 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,8 @@ Type your login/password for the superuser [on the login page](http://localhost: ### Stop all containers -The command below will stop and remove containers and networks created by `up`. See documentation for [docker-compose down](https://docs.docker.com/compose/reference/down/) for more details. +The command below will stop and remove containers, networks, volumes, and images +created by `up`. ```bash docker-compose down @@ -116,3 +117,26 @@ cvat: environment: DJANGO_LOG_SERVER_URL: https://annotation.example.com:5000 ``` + +### Share path + +You can use a share storage for data uploading during you are creating a task. To do that you can mount it to CVAT docker container. Example of docker-compose.override.yml for this purpose: + +```yml +version: "2.3" + +services: + cvat: + environment: + CVAT_SHARE_URL: "Mounted from /mnt/share host directory" + volumes: + cvat_share:/home/django/share:ro + +volumes: + cvat_share: + driver_opts: + type: none + device: /mnt/share + o: bind +``` +You can change the share device path to your actual share. For user convenience we have defined the enviroment variable $CVAT_SHARE_URL. This variable contains a text (url for example) which will be being shown in the client-share browser. diff --git a/cvat/__init__.py b/cvat/__init__.py index e69de29bb2d1..d8e62e54b356 100644 --- a/cvat/__init__.py +++ b/cvat/__init__.py @@ -0,0 +1,5 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + diff --git a/cvat/apps/authentication/__init__.py b/cvat/apps/authentication/__init__.py index b3d5c6b0799a..a7b92720ff0c 100644 --- a/cvat/apps/authentication/__init__.py +++ b/cvat/apps/authentication/__init__.py @@ -1 +1,7 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + default_app_config = 'cvat.apps.authentication.apps.AuthenticationConfig' + diff --git a/cvat/apps/authentication/admin.py b/cvat/apps/authentication/admin.py index 8c38f3f3dad5..af8dfc47525b 100644 --- a/cvat/apps/authentication/admin.py +++ b/cvat/apps/authentication/admin.py @@ -1,3 +1,9 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.contrib import admin # Register your models here. + diff --git a/cvat/apps/authentication/apps.py b/cvat/apps/authentication/apps.py index f742de0441c8..c0e41e420d6a 100644 --- a/cvat/apps/authentication/apps.py +++ b/cvat/apps/authentication/apps.py @@ -1,3 +1,8 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.apps import AppConfig from django.db.models.signals import post_migrate, post_save from .settings.authentication import DJANGO_AUTH_TYPE diff --git a/cvat/apps/authentication/decorators.py b/cvat/apps/authentication/decorators.py index 1e3d49183945..3ef9d2631ec6 100644 --- a/cvat/apps/authentication/decorators.py +++ b/cvat/apps/authentication/decorators.py @@ -1,3 +1,8 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.contrib.auth import REDIRECT_FIELD_NAME from django.shortcuts import resolve_url, reverse from django.http import JsonResponse diff --git a/cvat/apps/authentication/forms.py b/cvat/apps/authentication/forms.py index 9b6ab87779ae..238b15988e9b 100644 --- a/cvat/apps/authentication/forms.py +++ b/cvat/apps/authentication/forms.py @@ -1,3 +1,8 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.contrib.auth.forms import ( UsernameField, AuthenticationForm, diff --git a/cvat/apps/authentication/migrations/__init__.py b/cvat/apps/authentication/migrations/__init__.py index e69de29bb2d1..d8e62e54b356 100644 --- a/cvat/apps/authentication/migrations/__init__.py +++ b/cvat/apps/authentication/migrations/__init__.py @@ -0,0 +1,5 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + diff --git a/cvat/apps/authentication/models.py b/cvat/apps/authentication/models.py index 71a836239075..cdf3b0827bf1 100644 --- a/cvat/apps/authentication/models.py +++ b/cvat/apps/authentication/models.py @@ -1,3 +1,9 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.db import models # Create your models here. + diff --git a/cvat/apps/authentication/settings/__init__.py b/cvat/apps/authentication/settings/__init__.py index e69de29bb2d1..d8e62e54b356 100644 --- a/cvat/apps/authentication/settings/__init__.py +++ b/cvat/apps/authentication/settings/__init__.py @@ -0,0 +1,5 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + diff --git a/cvat/apps/authentication/settings/auth_ldap.py b/cvat/apps/authentication/settings/auth_ldap.py index 1abc5ac1cd55..01021060e106 100644 --- a/cvat/apps/authentication/settings/auth_ldap.py +++ b/cvat/apps/authentication/settings/auth_ldap.py @@ -1,3 +1,8 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.conf import settings import ldap from django_auth_ldap.config import LDAPSearch, NestedActiveDirectoryGroupType diff --git a/cvat/apps/authentication/settings/auth_simple.py b/cvat/apps/authentication/settings/auth_simple.py index dcd04277246a..41a18c98f12f 100644 --- a/cvat/apps/authentication/settings/auth_simple.py +++ b/cvat/apps/authentication/settings/auth_simple.py @@ -1,2 +1,8 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + # Specify groups that new users will have AUTH_SIMPLE_DEFAULT_GROUPS = [] + diff --git a/cvat/apps/authentication/settings/authentication.py b/cvat/apps/authentication/settings/authentication.py index 2cb9d4707e26..3948d0eeab7d 100644 --- a/cvat/apps/authentication/settings/authentication.py +++ b/cvat/apps/authentication/settings/authentication.py @@ -1,3 +1,8 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.conf import settings import os diff --git a/cvat/apps/authentication/signals.py b/cvat/apps/authentication/signals.py index 3a30ac2099e6..2dfc89dc6cdb 100644 --- a/cvat/apps/authentication/signals.py +++ b/cvat/apps/authentication/signals.py @@ -1,3 +1,8 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.db import models from django.conf import settings diff --git a/cvat/apps/authentication/templates/403.html b/cvat/apps/authentication/templates/403.html index daaa6181988d..e275bb1fe140 100644 --- a/cvat/apps/authentication/templates/403.html +++ b/cvat/apps/authentication/templates/403.html @@ -1,3 +1,8 @@ + {% extends "auth_base.html" %} {% block title %}Forbidden{% endblock %} diff --git a/cvat/apps/authentication/templates/login.html b/cvat/apps/authentication/templates/login.html index d039bcb6281f..128a8ccb849f 100644 --- a/cvat/apps/authentication/templates/login.html +++ b/cvat/apps/authentication/templates/login.html @@ -1,3 +1,8 @@ + {% extends "auth_base.html" %} {% block title %}Login{% endblock %} diff --git a/cvat/apps/authentication/templates/login_ldap.html b/cvat/apps/authentication/templates/login_ldap.html index ba89202242da..8cba181db5fd 100644 --- a/cvat/apps/authentication/templates/login_ldap.html +++ b/cvat/apps/authentication/templates/login_ldap.html @@ -1,3 +1,8 @@ + {% extends "auth_base.html" %} {% block title %}Login{% endblock %} diff --git a/cvat/apps/authentication/templates/note.html b/cvat/apps/authentication/templates/note.html index 2791447dacb4..ba2fea92248b 100644 --- a/cvat/apps/authentication/templates/note.html +++ b/cvat/apps/authentication/templates/note.html @@ -1,2 +1,7 @@ +

\ No newline at end of file diff --git a/cvat/apps/authentication/templates/register.html b/cvat/apps/authentication/templates/register.html index aa0793b8b689..b655e221eb84 100644 --- a/cvat/apps/authentication/templates/register.html +++ b/cvat/apps/authentication/templates/register.html @@ -1,3 +1,8 @@ + {% extends "auth_base.html" %} {% block title %}Create user{% endblock %} diff --git a/cvat/apps/authentication/templates/user_profile.html b/cvat/apps/authentication/templates/user_profile.html index 82f9c231e02c..37ea7d49b11e 100644 --- a/cvat/apps/authentication/templates/user_profile.html +++ b/cvat/apps/authentication/templates/user_profile.html @@ -1,3 +1,8 @@ +
{% if user.is_authenticated %} {% if user.ldap_user and 'thumbnailPhoto' in user.ldap_user.attrs %} diff --git a/cvat/apps/authentication/tests.py b/cvat/apps/authentication/tests.py index 7ce503c2dd97..53bc3b7adb85 100644 --- a/cvat/apps/authentication/tests.py +++ b/cvat/apps/authentication/tests.py @@ -1,3 +1,9 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.test import TestCase # Create your tests here. + diff --git a/cvat/apps/authentication/urls.py b/cvat/apps/authentication/urls.py index 926ce6b5a9ee..d12271719054 100644 --- a/cvat/apps/authentication/urls.py +++ b/cvat/apps/authentication/urls.py @@ -1,3 +1,8 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.urls import path import os diff --git a/cvat/apps/authentication/views.py b/cvat/apps/authentication/views.py index 2ab2d9676501..2964cf4b82a7 100644 --- a/cvat/apps/authentication/views.py +++ b/cvat/apps/authentication/views.py @@ -1,3 +1,8 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.shortcuts import render from django.contrib.auth.views import LoginView from django.http import HttpResponseRedirect diff --git a/cvat/apps/dashboard/__init__.py b/cvat/apps/dashboard/__init__.py index e69de29bb2d1..d8e62e54b356 100644 --- a/cvat/apps/dashboard/__init__.py +++ b/cvat/apps/dashboard/__init__.py @@ -0,0 +1,5 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + diff --git a/cvat/apps/dashboard/admin.py b/cvat/apps/dashboard/admin.py index 8c38f3f3dad5..af8dfc47525b 100644 --- a/cvat/apps/dashboard/admin.py +++ b/cvat/apps/dashboard/admin.py @@ -1,3 +1,9 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.contrib import admin # Register your models here. + diff --git a/cvat/apps/dashboard/apps.py b/cvat/apps/dashboard/apps.py index 50878e766268..73611b409636 100644 --- a/cvat/apps/dashboard/apps.py +++ b/cvat/apps/dashboard/apps.py @@ -1,5 +1,11 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.apps import AppConfig class DashboardConfig(AppConfig): name = 'dashboard' + diff --git a/cvat/apps/dashboard/migrations/__init__.py b/cvat/apps/dashboard/migrations/__init__.py index e69de29bb2d1..d8e62e54b356 100644 --- a/cvat/apps/dashboard/migrations/__init__.py +++ b/cvat/apps/dashboard/migrations/__init__.py @@ -0,0 +1,5 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + diff --git a/cvat/apps/dashboard/models.py b/cvat/apps/dashboard/models.py index 71a836239075..cdf3b0827bf1 100644 --- a/cvat/apps/dashboard/models.py +++ b/cvat/apps/dashboard/models.py @@ -1,3 +1,9 @@ + +# Copyright (C) 2018 Intel Corporation +# +# SPDX-License-Identifier: MIT + from django.db import models # Create your models here. + diff --git a/cvat/apps/dashboard/static/dashboard/js/dashboard.js b/cvat/apps/dashboard/static/dashboard/js/dashboard.js index 28dab1f10822..4a8986668ca4 100644 --- a/cvat/apps/dashboard/static/dashboard/js/dashboard.js +++ b/cvat/apps/dashboard/static/dashboard/js/dashboard.js @@ -1,9 +1,16 @@ +/* + * Copyright (C) 2018 Intel Corporation + * + * SPDX-License-Identifier: MIT + */ + "use strict"; /* Dashboard entrypoint */ window.cvat = window.cvat || {}; window.cvat.dashboard = window.cvat.dashboard || {}; window.cvat.dashboard.uiCallbacks = window.cvat.dashboard.uiCallbacks || []; +window.cvat.config = new Config(); window.cvat.dashboard.uiCallbacks.push(function(elements) { elements.each(function(idx) { @@ -93,6 +100,7 @@ function setupTaskCreator() { let cancelBrowseServer = $('#dashboardCancelBrowseServer'); let submitBrowseServer = $('#dashboardSubmitBrowseServer'); let flipImagesBox = $('#dashboardFlipImages'); + let zOrderBox = $('#dashboardZOrder'); let segmentSizeInput = $('#dashboardSegmentSize'); let customSegmentSize = $('#dashboardCustomSegment'); let overlapSizeInput = $('#dashboardOverlap'); @@ -109,6 +117,7 @@ function setupTaskCreator() { let bugTrackerLink = bugTrackerInput.prop('value'); let source = 'local'; let flipImages = false; + let zOrder = false; let segmentSize = 5000; let overlapSize = 0; let compressQuality = 50; @@ -168,7 +177,13 @@ function setupTaskCreator() { updateSelectedFiles(); }); - flipImagesBox.on('click', (e) => {flipImages = e.target.checked;}); + flipImagesBox.on('click', (e) => { + flipImages = e.target.checked; + }); + + zOrderBox.on('click', (e) => { + zOrder = e.target.checked; + }); customSegmentSize.on('change', (e) => segmentSizeInput.prop('disabled', !e.target.checked)); customOverlapSize.on('change', (e) => overlapSizeInput.prop('disabled', !e.target.checked)); customCompressQuality.on('change', (e) => imageQualityInput.prop('disabled', !e.target.checked)); @@ -258,6 +273,7 @@ function setupTaskCreator() { taskData.append('bug_tracker_link', bugTrackerLink); taskData.append('labels', labels); taskData.append('flip_flag', flipImages); + taskData.append('z_order', zOrder); taskData.append('storage', source); if (customSegmentSize.prop('checked')) { @@ -285,7 +301,11 @@ function setupTaskCreator() { taskMessage.css('color', 'red'); taskMessage.text(response); }, - () => submitCreate.prop('disabled', false)); + () => submitCreate.prop('disabled', false), + (status) => { + taskMessage.css('color', 'blue'); + taskMessage.text(status); + }); }); function updateSelectedFiles() { @@ -385,7 +405,7 @@ function setupSearch() { /* Server requests */ -function createTaskRequest(oData, onSuccessRequest, onSuccessCreate, onError, onComplete) { +function createTaskRequest(oData, onSuccessRequest, onSuccessCreate, onError, onComplete, onUpdateStatus) { $.ajax({ url: '/create/task', type: 'POST', @@ -433,6 +453,9 @@ function createTaskRequest(oData, onSuccessRequest, onSuccessCreate, onError, on onComplete(); onError(data.stderr); } + else if (data['state'] == 'started' && 'status' in data) { + onUpdateStatus(data['status']); + } } } } @@ -488,7 +511,7 @@ function uploadAnnotationRequest() { function loadXML(e) { input.remove(); - let overlay = showOverlay("File uploading.."); + let overlay = showOverlay("File is being uploaded.."); let file = e.target.files[0]; let fileReader = new FileReader(); fileReader.onload = (e) => parseFile(e, overlay); @@ -501,39 +524,48 @@ function uploadAnnotationRequest() { $.ajax({ url: '/get/task/' + window.cvat.dashboard.taskID, success: function(data) { - let labels = new LabelsInfo(data.spec); - let fakeJob = { + let annotationParser = new AnnotationParser({ start: 0, - stop: data.size + stop: data.size, + image_meta_data: data.image_meta_data, + flipped: data.flipped + }, new LabelsInfo(data.spec)); + + let asyncParse = function() { + let parsed = null; + try { + parsed = annotationParser.parse(xmlText); + } + catch(error) { + overlay.remove(); + showMessage("Parsing errors was occured. " + error); + return; + } + + let asyncSave = function() { + $.ajax({ + url: '/save/annotation/task/' + window.cvat.dashboard.taskID, + type: 'POST', + data: JSON.stringify(parsed), + contentType: 'application/json', + success: function() { + let message = 'Annotation successfully uploaded'; + showMessage(message); + }, + error: function(response) { + let message = 'Annotation uploading errors was occured. ' + response.responseText; + showMessage(message); + }, + complete: () => overlay.remove() + }); + }; + + overlay.setMessage('Annotation is being saved..'); + setTimeout(asyncSave); }; - let annotationParser = new AnnotationParser(labels, fakeJob); - let parsed = null; - try { - parsed = annotationParser.parse(xmlText); - } - catch(error) { - let message = "Parsing errors was occured. " + error; - showMessage(message); - overlay.remove(); - return; - } - overlay.setMessage('Annotation saving..'); - - $.ajax({ - url: '/save/annotation/task/' + window.cvat.dashboard.taskID, - type: 'POST', - data: JSON.stringify(parsed), - contentType: 'application/json', - success: function() { - let message = 'Annotation successfully uploaded'; - showMessage(message); - }, - error: function(response) { - let message = 'Annotation uploading errors was occured. ' + response.responseText; - showMessage(message); - }, - complete: () => overlay.remove() - }); + + overlay.setMessage('File is being parsed..'); + setTimeout(asyncParse); }, error: function(response) { overlay.remove(); diff --git a/cvat/apps/dashboard/static/dashboard/stylesheet.css b/cvat/apps/dashboard/static/dashboard/stylesheet.css index 1f938ece678b..a3430e857561 100644 --- a/cvat/apps/dashboard/static/dashboard/stylesheet.css +++ b/cvat/apps/dashboard/static/dashboard/stylesheet.css @@ -1,3 +1,9 @@ +/* + * Copyright (C) 2018 Intel Corporation + * + * SPDX-License-Identifier: MIT + */ + .dashboardTaskUI { margin: 5px auto; width: 1200px; diff --git a/cvat/apps/dashboard/templates/dashboard/dashboard.html b/cvat/apps/dashboard/templates/dashboard/dashboard.html index 41bbfcb71fd1..be700127a325 100644 --- a/cvat/apps/dashboard/templates/dashboard/dashboard.html +++ b/cvat/apps/dashboard/templates/dashboard/dashboard.html @@ -1,3 +1,8 @@ + {% extends 'engine/base.html' %} {% load static %} {% load pagination_tags %} @@ -25,9 +30,8 @@ + - - - + + + + + + + {% for js_file in js_3rdparty %} {% endfor %} @@ -25,28 +35,25 @@ + - + + - - - - - - - + + - - + + + - {% endblock %} @@ -58,9 +65,31 @@ - - + + + + + + + + + + + + +
@@ -101,10 +130,47 @@ + + +
+
+ + + + + + + +
+
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
@@ -115,85 +181,94 @@
-
+


- - -