diff --git a/CHANGELOG.md b/CHANGELOG.md index 726e5775..af02b0be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.0-alpha] - Unreleased +## [1.0.0-beta] - Unreleased ### Added - Special behaviour for attribute value ``__undefined__`` (invisibility, no shortcuts to be set in AAM) +- Dialog window with some helpful information about using filters ### Changed - @@ -18,11 +19,22 @@ 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 ### Security - +## [1.0.0-alpha] - 2020-03-31 +### Added +- Data streaming using chunks (https://github.com/opencv/cvat/pull/1007) +- New UI: showing file names in UI (https://github.com/opencv/cvat/pull/1311) +- New UI: delete a point from context menu (https://github.com/opencv/cvat/pull/1292) + +### Fixed +- Git app cannot clone a repository (https://github.com/opencv/cvat/pull/1330) +- New UI: preview position in task details (https://github.com/opencv/cvat/pull/1312) +- AWS deployment (https://github.com/opencv/cvat/pull/1316) + ## [0.6.1] - 2020-03-21 ### Changed - VOC task export now does not use official label map by default, but takes one diff --git a/cvat-canvas/src/typescript/drawHandler.ts b/cvat-canvas/src/typescript/drawHandler.ts index 4afe75ec..a2c401c5 100644 --- a/cvat-canvas/src/typescript/drawHandler.ts +++ b/cvat-canvas/src/typescript/drawHandler.ts @@ -50,6 +50,7 @@ export class DrawHandlerImpl implements DrawHandler { // so, methods like draw() just undefined for SVG.Shape, but nevertheless they exist private drawInstance: any; private initialized: boolean; + private canceled: boolean; private pointsGroup: SVG.G | null; private shapeSizeElement: ShapeSizeElement; @@ -149,6 +150,7 @@ export class DrawHandlerImpl implements DrawHandler { // Clear drawing this.drawInstance.draw('stop'); } + this.drawInstance.off(); this.drawInstance.remove(); this.drawInstance = null; @@ -161,6 +163,10 @@ export class DrawHandlerImpl implements DrawHandler { if (this.crosshair) { this.removeCrosshair(); } + + if (!this.drawData.initialState) { + this.onDrawDone(null); + } } private initDrawing(): void { @@ -175,8 +181,9 @@ export class DrawHandlerImpl implements DrawHandler { const bbox = (e.target as SVGRectElement).getBBox(); const [xtl, ytl, xbr, ybr] = this.getFinalRectCoordinates(bbox); const { shapeType } = this.drawData; - this.cancel(); + this.release(); + if (this.canceled) return; if ((xbr - xtl) * (ybr - ytl) >= consts.AREA_THRESHOLD) { this.onDrawDone({ shapeType, @@ -290,11 +297,11 @@ export class DrawHandlerImpl implements DrawHandler { this.drawInstance.on('drawdone', (e: CustomEvent): void => { const targetPoints = pointsToArray((e.target as SVGElement).getAttribute('points')); - const { points, box } = this.getFinalPolyshapeCoordinates(targetPoints); const { shapeType } = this.drawData; - this.cancel(); + this.release(); + if (this.canceled) return; if (shapeType === 'polygon' && ((box.xbr - box.xtl) * (box.ybr - box.ytl) >= consts.AREA_THRESHOLD) && points.length >= 3 * 2) { @@ -598,6 +605,7 @@ export class DrawHandlerImpl implements DrawHandler { this.canvas = canvas; this.text = text; this.initialized = false; + this.canceled = false; this.drawData = null; this.geometry = null; this.crosshair = null; @@ -671,17 +679,18 @@ export class DrawHandlerImpl implements DrawHandler { this.geometry = geometry; if (drawData.enabled) { + this.canceled = false; this.drawData = drawData; this.initDrawing(); this.startDraw(); } else { - this.cancel(); + this.release(); this.drawData = drawData; } } public cancel(): void { + this.canceled = true; this.release(); - this.onDrawDone(null); } } diff --git a/cvat-core/src/session.js b/cvat-core/src/session.js index 987b3fae..0ae7fb1a 100644 --- a/cvat-core/src/session.js +++ b/cvat-core/src/session.js @@ -441,7 +441,7 @@ * Returns the ranges of cached frames * @method ranges * @memberof Session.frames - * @returns {Array{string}} + * @returns {Array.} * @instance * @async */ @@ -520,7 +520,8 @@ * @returns {HistoryActions} * @throws {module:API.cvat.exceptions.PluginError} * @throws {module:API.cvat.exceptions.ArgumentError} - * @returns {[string, number][]} array of pairs [action name, frame number] + * @returns {Array.>} + * array of pairs [action name, frame number] * @instance * @async */ diff --git a/cvat-ui/src/components/annotation-page/annotations-filters-input.tsx b/cvat-ui/src/components/annotation-page/annotations-filters-input.tsx index 39ff37b6..b6e98198 100644 --- a/cvat-ui/src/components/annotation-page/annotations-filters-input.tsx +++ b/cvat-ui/src/components/annotation-page/annotations-filters-input.tsx @@ -2,9 +2,14 @@ // // SPDX-License-Identifier: MIT -import React from 'react'; +import React, { useState } from 'react'; import { connect } from 'react-redux'; import Select, { SelectValue, LabeledValue } from 'antd/lib/select'; +import Title from 'antd/lib/typography/Title'; +import Text from 'antd/lib/typography/Text'; +import Paragraph from 'antd/lib/typography/Paragraph'; +import Tooltip from 'antd/lib/tooltip'; +import Modal from 'antd/lib/modal'; import Icon from 'antd/lib/icon'; import { @@ -16,6 +21,8 @@ import { CombinedState } from 'reducers/interfaces'; interface StateToProps { annotationsFilters: string[]; annotationsFiltersHistory: string[]; + searchForwardShortcut: string; + searchBackwardShortcut: string; } interface DispatchToProps { @@ -30,11 +37,16 @@ function mapStateToProps(state: CombinedState): StateToProps { filtersHistory: annotationsFiltersHistory, }, }, + shortcuts: { + normalizedKeyMap, + }, } = state; return { annotationsFilters, annotationsFiltersHistory, + searchForwardShortcut: normalizedKeyMap.SEARCH_FORWARD, + searchBackwardShortcut: normalizedKeyMap.SEARCH_BACKWARD, }; } @@ -56,13 +68,74 @@ function mapDispatchToProps(dispatch: any): DispatchToProps { }; } +function filtersHelpModalContent( + searchForwardShortcut: string, + searchBackwardShortcut: string, +): JSX.Element { + return ( + <> + + General + + + You can use filters to display only subset of objects on a frame + or to search objects that satisfy the filters using hotkeys + + {` ${searchForwardShortcut} `} + + and + + {` ${searchBackwardShortcut} `} + + + + Supported properties: + width, height, label, serverID, clientID, type, shape, occluded +
+ Supported operators: + ==, !=, >, >=, <, <=, ~=, (), & and | +
+ + If you have double quotes in your query string, + please escape them using back slash: \" (see the latest example) + +
+ All properties and values are case-sensitive. + CVAT uses json queries to perform search. +
+ + Examples +
    +
  • label=="car" | label==["road sign"]
  • +
  • width >= height
  • +
  • attr["Attribute 1"] == attr["Attribute 2"]
  • +
  • clientID == 50
  • +
  • + (label=="car" & attr["parked"]==true) + | (label=="pedestrian" & width > 150) +
  • +
  • + (( label==["car \"mazda\""]) + & (attr["sunglasses"]==true + | (width > 150 | height > 150 & (clientID == serverID))))) +
  • +
+
+ + ); +} + function AnnotationsFiltersInput(props: StateToProps & DispatchToProps): JSX.Element { const { annotationsFilters, annotationsFiltersHistory, + searchForwardShortcut, + searchBackwardShortcut, changeAnnotationsFilters, } = props; + const [underCursor, setUnderCursor] = useState(false); + return (