Skip to content

Commit

Permalink
Merge branch 'develop' into zm/coco-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max authored Jun 26, 2020
2 parents f929b4b + db29291 commit 8325628
Show file tree
Hide file tree
Showing 93 changed files with 1,389 additions and 708 deletions.
16 changes: 16 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "stylelint-config-standard",
"rules": {
"indentation": 4,
"value-keyword-case": null,
"selector-combinator-space-after": null,
"no-descending-specificity": null,
"at-rule-no-unknown": [true, {
"ignoreAtRules": ["extend"]
}],
"selector-type-no-unknown": [true, {
"ignoreTypes": ["first-child"]
}]
}

}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Built-in search for labels when create an object or change a label (<https://github.com/opencv/cvat/pull/1683>)
- Better validation of labels and attributes in raw viewer (<https://github.com/opencv/cvat/pull/1727>)
- ClamAV antivirus integration (<https://github.com/opencv/cvat/pull/1712>)
- Added canvas background color selector (<https://github.com/opencv/cvat/pull/1705>)
- SCSS files linting with Stylelint tool (<https://github.com/opencv/cvat/pull/1766>)
- Supported import and export or single boxes in MOT format (https://github.com/opencv/cvat/pull/1764)
- [Datumaro] Added `stats` command, which shows some dataset statistics like image mean and std (https://github.com/opencv/cvat/pull/1734)
- Add option to upload annotations upon task creation on CLI
Expand All @@ -27,9 +29,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Removed information about e-mail from the basic user information (<https://github.com/opencv/cvat/pull/1627>)
- Update https install manual. Makes it easier and more robust. Includes automatic renewing of lets encrypt certificates.
- Settings page move to the modal. (<https://github.com/opencv/cvat/pull/1705>)
- Implemented import and export of annotations with relative image paths (<https://github.com/opencv/cvat/pull/1463>)
- Using only single click to start editing or remove a point (<https://github.com/opencv/cvat/pull/1571>)
- Added support for attributes in VOC XML format (https://github.com/opencv/cvat/pull/1792)
- Added annotation attributes in COCO format (https://github.com/opencv/cvat/pull/1782)
- Colorized object items in the side panel (<https://github.com/opencv/cvat/pull/1753>)

### Deprecated
-
Expand All @@ -46,7 +51,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Wrong description on register view for the username field (<https://github.com/opencv/cvat/pull/1667>)
- Wrong resolution for resizing a shape (<https://github.com/opencv/cvat/pull/1667>)
- React warning because of not unique keys in labels viewer (<https://github.com/opencv/cvat/pull/1727>)
- Fixed issue tracker (<https://github.com/opencv/cvat/pull/1705>)
- Fixed canvas fit after sidebar open/close event (<https://github.com/opencv/cvat/pull/1705>)
- A couple of exceptions in AAM related with early object activation (<https://github.com/opencv/cvat/pull/1755>)
- Propagation from the latest frame (<https://github.com/opencv/cvat/pull/1800>)
- Number attribute value validation (didn't work well with floats) (<https://github.com/opencv/cvat/pull/1800>)
- Annotations aren't updated after reopening a task (<https://github.com/opencv/cvat/pull/1753>)
- Labels aren't updated after reopening a task (<https://github.com/opencv/cvat/pull/1753>)
- Canvas isn't fitted after collapsing side panel in attribute annotation mode (<https://github.com/opencv/cvat/pull/1753>)


### Security
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ for development
- [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)
- [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)
Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-canvas",
"version": "1.2.0",
"version": "1.2.1",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {
Expand Down
50 changes: 36 additions & 14 deletions cvat-canvas/src/scss/canvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ polyline.cvat_shape_drawing_opacity {
fill: white;
cursor: default;
font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
text-shadow: 0px 0px 4px black;
text-shadow: 0 0 4px black;
user-select: none;
pointer-events: none;
}
Expand All @@ -54,47 +54,55 @@ polyline.cvat_shape_drawing_opacity {
.cvat_canvas_shape_grouping {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;

fill: darkmagenta;
}

polyline.cvat_canvas_shape_grouping {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;

stroke: darkmagenta;
}

.cvat_canvas_shape_merging {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;

fill: blue;
}

polyline.cvat_canvas_shape_merging {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;

stroke: blue;
}

polyline.cvat_canvas_shape_splitting {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;

stroke: dodgerblue;
}

.cvat_canvas_shape_splitting {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;

fill: dodgerblue;
}

.cvat_canvas_shape_drawing {
@extend .cvat_shape_drawing_opacity;

fill: white;
stroke: black;
}

.cvat_canvas_zoom_selection {
@extend .cvat_shape_action_dasharray;

stroke: #096dd9;
fill-opacity: 0;
}
Expand All @@ -103,7 +111,8 @@ polyline.cvat_canvas_shape_splitting {
stroke-dasharray: 5;
}

.cvat_canvas_shape .svg_select_points, .cvat_canvas_shape .cvat_canvas_cuboid_projections {
.cvat_canvas_shape .svg_select_points,
.cvat_canvas_shape .cvat_canvas_cuboid_projections {
stroke-dasharray: none;
}

Expand All @@ -130,20 +139,24 @@ polyline.cvat_canvas_shape_splitting {
pointer-events: none;
}

.svg_select_points_lb:hover, .svg_select_points_rt:hover {
.svg_select_points_lb:hover,
.svg_select_points_rt:hover {
cursor: nesw-resize;
}

.svg_select_points_lt:hover, .svg_select_points_rb:hover {
.svg_select_points_lt:hover,
.svg_select_points_rb:hover {
cursor: nwse-resize;
}

.svg_select_points_l:hover, .svg_select_points_r:hover,
.svg_select_points_l:hover,
.svg_select_points_r:hover,
.svg_select_points_ew:hover {
cursor: ew-resize;
}

.svg_select_points_t:hover, .svg_select_points_b:hover {
.svg_select_points_t:hover,
.svg_select_points_b:hover {
cursor: ns-resize;
}

Expand Down Expand Up @@ -175,7 +188,7 @@ polyline.cvat_canvas_shape_splitting {
height: calc(100% - 10px);
margin: 5px;
border-radius: 5px;
background-color: white;
background-color: inherit;
overflow: hidden;
position: relative;
}
Expand All @@ -202,7 +215,6 @@ polyline.cvat_canvas_shape_splitting {
pointer-events: none;
width: 100%;
height: 100%;
pointer-events: none;
}

#cvat_canvas_background {
Expand All @@ -211,7 +223,7 @@ polyline.cvat_canvas_shape_splitting {
background-repeat: no-repeat;
width: 100%;
height: 100%;
box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.75);
box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.75);
}

#cvat_canvas_bitmap {
Expand All @@ -221,7 +233,7 @@ polyline.cvat_canvas_shape_splitting {
background: black;
width: 100%;
height: 100%;
box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.75);
box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.75);
}

#cvat_canvas_grid {
Expand All @@ -230,7 +242,6 @@ polyline.cvat_canvas_shape_splitting {
pointer-events: none;
width: 100%;
height: 100%;
pointer-events: none;
}

#cvat_canvas_grid_pattern {
Expand All @@ -248,7 +259,18 @@ polyline.cvat_canvas_shape_splitting {
}

@keyframes loadingAnimation {
0% {stroke-dashoffset: 1; stroke: #09c;}
50% {stroke-dashoffset: 100; stroke: #f44;}
100% {stroke-dashoffset: 300; stroke: #09c;}
0% {
stroke-dashoffset: 1;
stroke: #09c;
}

50% {
stroke-dashoffset: 100;
stroke: #f44;
}

100% {
stroke-dashoffset: 300;
stroke: #09c;
}
}
23 changes: 22 additions & 1 deletion cvat-canvas/src/typescript/canvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,12 +911,32 @@ export class CanvasViewImpl implements CanvasView, Listener {
if (reason === UpdateReasons.CONFIG_UPDATED) {
const { activeElement } = this;
this.deactivate();

if (model.configuration.displayAllText && !this.configuration.displayAllText) {
for (const i in this.drawnStates) {
if (!(i in this.svgTexts)) {
this.svgTexts[i] = this.addText(this.drawnStates[i]);
this.updateTextPosition(
this.svgTexts[i],
this.svgShapes[i],
);
}
}
} else if (model.configuration.displayAllText === false
&& this.configuration.displayAllText) {
for (const i in this.drawnStates) {
if (i in this.svgTexts && Number.parseInt(i, 10) !== activeElement.clientID) {
this.svgTexts[i].remove();
delete this.svgTexts[i];
}
}
}

this.configuration = model.configuration;
this.activate(activeElement);
this.editHandler.configurate(this.configuration);
this.drawHandler.configurate(this.configuration);

// todo: setup text, add if doesn't exist and enabled
// remove if exist and not enabled
// this.setupObjects([]);
// this.setupObjects(model.objects);
Expand Down Expand Up @@ -1208,6 +1228,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
pinned: state.pinned,
updated: state.updated,
frame: state.frame,
label: state.label,
};
}

Expand Down
1 change: 1 addition & 0 deletions cvat-canvas/src/typescript/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface DrawnState {
pinned?: boolean;
updated: number;
frame: number;
label: any;
}

// Translate point array from the canvas coordinate system
Expand Down
6 changes: 4 additions & 2 deletions cvat-canvas/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ const webConfig = {
target: 'web',
mode: 'production',
devtool: 'source-map',
entry: './src/typescript/canvas.ts',
entry: {
'cvat-canvas': './src/typescript/canvas.ts',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'cvat-canvas.js',
filename: '[name].[contenthash].js',
library: 'canvas',
libraryTarget: 'window',
},
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-core",
"version": "3.0.0",
"version": "3.1.0",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js",
"scripts": {
Expand Down
20 changes: 11 additions & 9 deletions cvat-core/src/annotations-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -797,15 +797,17 @@
.concat(imported.tracks)
.concat(imported.shapes);

this.history.do(HistoryActions.CREATED_OBJECTS, () => {
importedArray.forEach((object) => {
object.removed = true;
});
}, () => {
importedArray.forEach((object) => {
object.removed = false;
});
}, importedArray.map((object) => object.clientID), objectStates[0].frame);
if (objectStates.length) {
this.history.do(HistoryActions.CREATED_OBJECTS, () => {
importedArray.forEach((object) => {
object.removed = true;
});
}, () => {
importedArray.forEach((object) => {
object.removed = false;
});
}, importedArray.map((object) => object.clientID), objectStates[0].frame);
}

return importedArray.map((value) => value.clientID);
}
Expand Down
3 changes: 1 addition & 2 deletions cvat-core/src/annotations-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@

if (type === AttributeType.NUMBER) {
return +value >= +values[0]
&& +value <= +values[1]
&& !((+value - +values[0]) % +values[2]);
&& +value <= +values[1];
}

if (type === AttributeType.CHECKBOX) {
Expand Down
10 changes: 10 additions & 0 deletions cvat-core/src/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@
}
}

async function closeSession(session) {
const sessionType = session instanceof Task ? 'task' : 'job';
const cache = getCache(sessionType);

if (cache.has(session)) {
cache.delete(session);
}
}

async function getAnnotations(session, frame, allTracks, filters) {
const sessionType = session instanceof Task ? 'task' : 'job';
const cache = getCache(sessionType);
Expand Down Expand Up @@ -365,5 +374,6 @@
redoActions,
clearActions,
getActions,
closeSession,
};
})();
9 changes: 5 additions & 4 deletions cvat-core/src/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,11 @@
* @readonly
*/
const colors = [
'#FF355E', '#E936A7', '#FD5B78', '#FF007C', '#FF00CC', '#66FF66',
'#50BFE6', '#CCFF00', '#FFFF66', '#FF9966', '#FF6037', '#FFCC33',
'#AAF0D1', '#FF3855', '#FFF700', '#A7F432', '#FF5470', '#FAFA37',
'#FF7A00', '#FF9933', '#AFE313', '#00CC99', '#FF5050', '#733380',
'#33ddff', '#fa3253', '#34d1b7', '#ff007c', '#ff6037', '#ddff33',
'#24b353', '#b83df5', '#66ff66', '#32b7fa', '#ffcc33', '#83e070',
'#fafa37', '#5986b3', '#8c78f0', '#ff6a4d', '#f078f0', '#2a7dd1',
'#b25050', '#cc3366', '#cc9933', '#aaf0d1', '#ff00cc', '#3df53d',
'#fa32b7', '#fa7dbb', '#ff355e', '#f59331', '#3d3df5', '#733380',
];

module.exports = {
Expand Down
Loading

0 comments on commit 8325628

Please sign in to comment.