diff --git a/CHANGELOG.md b/CHANGELOG.md index ec84bfb5..e32ad1bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Special behaviour for attribute value ``__undefined__`` (invisibility, no shortcuts to be set in AAM) - Dialog window with some helpful information about using filters - Ability to display a bitmap in the new UI +- Button to reset colors settings (brightness, saturation, contrast) in the new UI - Added option to display shape text always ### Changed @@ -22,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - New shape is added when press ``esc`` when drawing instead of cancellation +- Fixed dextr segmentation. +- Fixed `FileNotFoundError` during dump after moving format files ### Security - diff --git a/cvat-ui/src/components/settings-page/player-settings.tsx b/cvat-ui/src/components/settings-page/player-settings.tsx index 779a03b0..6b834122 100644 --- a/cvat-ui/src/components/settings-page/player-settings.tsx +++ b/cvat-ui/src/components/settings-page/player-settings.tsx @@ -6,6 +6,7 @@ import React from 'react'; import { Row, Col } from 'antd/lib/grid'; import Checkbox, { CheckboxChangeEvent } from 'antd/lib/checkbox'; +import Button from 'antd/lib/button'; import Slider from 'antd/lib/slider'; import Select from 'antd/lib/select'; import InputNumber from 'antd/lib/input-number'; @@ -16,6 +17,7 @@ import { clamp } from 'utils/math'; import { BackJumpIcon, ForwardJumpIcon } from 'icons'; import { FrameSpeed, GridColor } from 'reducers/interfaces'; + interface Props { frameStep: number; frameSpeed: FrameSpeed; @@ -263,6 +265,19 @@ export default function PlayerSettingsComponent(props: Props): JSX.Element { /> + + + + + ); } diff --git a/cvat-ui/src/components/settings-page/styles.scss b/cvat-ui/src/components/settings-page/styles.scss index d54c7206..63269c43 100644 --- a/cvat-ui/src/components/settings-page/styles.scss +++ b/cvat-ui/src/components/settings-page/styles.scss @@ -5,6 +5,9 @@ @import '../../base.scss'; .cvat-settings-page { + height: 90%; + overflow-y: auto; + > div:nth-child(1) { margin-top: 30px; margin-bottom: 10px; @@ -76,12 +79,19 @@ width: 90px; } +.cvat-player-reset-color-settings, .cvat-player-settings-brightness, .cvat-player-settings-contrast, .cvat-player-settings-saturation { width: 40%; } +.cvat-player-reset-color-settings { + > .ant-col { + text-align: center; + } +} + .cvat-settings-page-back-button { width: 100px; margin-top: 15px; diff --git a/cvat/apps/annotation/serializers.py b/cvat/apps/annotation/serializers.py index 8fa8b345..7284c041 100644 --- a/cvat/apps/annotation/serializers.py +++ b/cvat/apps/annotation/serializers.py @@ -1,8 +1,10 @@ -# Copyright (C) 2018 Intel Corporation +# Copyright (C) 2018-2020 Intel Corporation # # SPDX-License-Identifier: MIT +from django.utils import timezone from rest_framework import serializers + from cvat.apps.annotation import models class AnnotationDumperSerializer(serializers.ModelSerializer): @@ -57,6 +59,9 @@ class AnnotationFormatSerializer(serializers.ModelSerializer): def update(self, instance, validated_data): dumper_names = [handler["display_name"] for handler in validated_data["annotationdumper_set"]] loader_names = [handler["display_name"] for handler in validated_data["annotationloader_set"]] + instance.handler_file = validated_data.get('handler_file', instance.handler_file) + instance.owner = validated_data.get('owner', instance.owner) + instance.updated_date = timezone.localtime(timezone.now()) handlers_to_delete = [d for d in instance.annotationdumper_set.all() if d.display_name not in dumper_names] + \ [l for l in instance.annotationloader_set.all() if l.display_name not in loader_names] diff --git a/cvat/apps/dextr_segmentation/dextr.py b/cvat/apps/dextr_segmentation/dextr.py index 628961ff..db8c71e7 100644 --- a/cvat/apps/dextr_segmentation/dextr.py +++ b/cvat/apps/dextr_segmentation/dextr.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: MIT from cvat.apps.auto_annotation.inference_engine import make_plugin_or_core, make_network +from cvat.apps.engine.frame_provider import FrameProvider import os import cv2 @@ -29,7 +30,7 @@ class DEXTR_HANDLER: raise Exception("DEXTR_MODEL_DIR is not defined") - def handle(self, im_path, points): + def handle(self, db_data, frame, points): # Lazy initialization if not self._plugin: self._plugin = make_plugin_or_core() @@ -42,7 +43,9 @@ class DEXTR_HANDLER: else: self._exec_network = self._plugin.load(network=self._network) - image = PIL.Image.open(im_path) + frame_provider = FrameProvider(db_data) + image = frame_provider.get_frame(frame, frame_provider.Quality.ORIGINAL) + image = PIL.Image.open(image[0]) numpy_image = np.array(image) points = np.asarray([[int(p["x"]), int(p["y"])] for p in points], dtype=int) bounding_box = ( diff --git a/cvat/apps/dextr_segmentation/views.py b/cvat/apps/dextr_segmentation/views.py index 0a837b3a..a4827e99 100644 --- a/cvat/apps/dextr_segmentation/views.py +++ b/cvat/apps/dextr_segmentation/views.py @@ -12,15 +12,14 @@ from cvat.apps.dextr_segmentation.dextr import DEXTR_HANDLER import django_rq import json -import os import rq __RQ_QUEUE_NAME = "default" __DEXTR_HANDLER = DEXTR_HANDLER() -def _dextr_thread(im_path, points): +def _dextr_thread(db_data, frame, points): job = rq.get_current_job() - job.meta["result"] = __DEXTR_HANDLER.handle(im_path, points) + job.meta["result"] = __DEXTR_HANDLER.handle(db_data, frame, points) job.save_meta() @@ -38,8 +37,7 @@ def create(request, jid): slogger.job[jid].info("create dextr request for the JOB: {} ".format(jid) + "by the USER: {} on the FRAME: {}".format(username, frame)) - db_task = Job.objects.select_related("segment__task").get(id=jid).segment.task - im_path = os.path.realpath(db_task.get_frame_path(frame)) + db_data = Job.objects.select_related("segment__task__data").get(id=jid).segment.task.data queue = django_rq.get_queue(__RQ_QUEUE_NAME) rq_id = "dextr.create/{}/{}".format(jid, username) @@ -53,7 +51,7 @@ def create(request, jid): job.delete() queue.enqueue_call(func=_dextr_thread, - args=(im_path, points), + args=(db_data, frame, points), job_id=rq_id, timeout=15, ttl=30)