Skip to content

Commit 51550ac

Browse files
authored
Merge branch 'develop' into zm/dm-mot-format
2 parents 6875c79 + 731b896 commit 51550ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2067
-577
lines changed

CHANGELOG.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,32 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [1.0.0.alpha] - 2020-02-XX
7+
## [1.0.0-beta] - Unreleased
8+
### Added
9+
-
10+
11+
### Changed
12+
- VOC task export now does not use official label map by default, but takes one
13+
from the source task to avoid primary-class and class part name
14+
clashing ([#1275](https://github.com/opencv/cvat/issues/1275))
15+
16+
### Deprecated
17+
-
18+
19+
### Removed
20+
-
21+
22+
### Fixed
23+
- File names in LabelMe format export are no longer truncated ([#1259](https://github.com/opencv/cvat/issues/1259))
24+
- `occluded` and `z_order` annotation attributes are now correctly passed to Datumaro ([#1271](https://github.com/opencv/cvat/pull/1271))
25+
- Annotation-less tasks now can be exported as empty datasets in COCO ([#1277](https://github.com/opencv/cvat/issues/1277))
26+
- Frame name matching for video annotations import -
27+
allowed `frame_XXXXXX[.ext]` format ([#1274](https://github.com/opencv/cvat/pull/1274))
28+
29+
### Security
30+
- Bump acorn from 6.3.0 to 6.4.1 in /cvat-ui ([#1270](https://github.com/opencv/cvat/pull/1270))
31+
32+
## [0.6.0] - 2020-03-15
833
### Added
934
- Server only support for projects. Extend REST API v1 (/api/v1/projects*)
1035
- Ability to get basic information about users without admin permissions ([#750](https://github.com/opencv/cvat/issues/750))
@@ -28,12 +53,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2853
- Yolov3 interpretation script fix and changes to mapping.json
2954
- YOLO format support ([#1151](https://github.com/opencv/cvat/pull/1151))
3055

31-
### Deprecated
32-
-
33-
34-
### Removed
35-
-
36-
3756
### Fixed
3857
- Exception in Git plugin [#826](https://github.com/opencv/cvat/issues/826)
3958
- Label ids in TFrecord format now start from 1 [#866](https://github.com/opencv/cvat/issues/866)
@@ -42,8 +61,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4261
- Output labels for VOC format can be specified with Datumaro [#942](https://github.com/opencv/cvat/issues/942)
4362
- Annotations can be filtered before dumping with Datumaro [#994](https://github.com/opencv/cvat/issues/994)
4463

45-
### Security
46-
-
64+
## [0.5.2] - 2019-12-15
65+
### Fixed
66+
- Frozen version of scikit-image==0.15 in requirements.txt because next releases don't support Python 3.5
4767

4868
## [0.5.1] - 2019-10-17
4969
### Added

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Next steps should work on clear Ubuntu 18.04.
1515
- Install necessary dependencies:
1616

1717
```sh
18-
$ sudo apt-get update && apt-get --no-install-recommends install -y nodejs npm curl redis-server python3-dev python3-pip python3-venv libldap2-dev libsasl2-dev
18+
$ sudo apt-get update && sudo apt-get --no-install-recommends install -y ffmpeg build-essential nodejs npm curl redis-server python3-dev python3-pip python3-venv libldap2-dev libsasl2-dev
1919
```
2020

2121
- Install [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux#_debian-and-ubuntu-based-distributions)
@@ -28,7 +28,7 @@ git clone https://github.com/opencv/cvat
2828
cd cvat && mkdir logs keys
2929
python3 -m venv .env
3030
. .env/bin/activate
31-
pip install -U pip wheel
31+
pip install -U pip wheel setuptools
3232
pip install -r cvat/requirements/development.txt
3333
pip install -r datumaro/requirements.txt
3434
python manage.py migrate

cvat-canvas/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cvat-canvas/src/typescript/canvasView.ts

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,10 @@ export class CanvasViewImpl implements CanvasView, Listener {
264264
y + height / 2,
265265
]);
266266

267+
const canvasOffset = this.canvas.getBoundingClientRect();
267268
const [cx, cy] = [
268-
this.canvas.clientWidth / 2 + this.canvas.offsetLeft,
269-
this.canvas.clientHeight / 2 + this.canvas.offsetTop,
269+
this.canvas.clientWidth / 2 + canvasOffset.left,
270+
this.canvas.clientHeight / 2 + canvasOffset.top,
270271
];
271272

272273
const dragged = {
@@ -725,7 +726,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
725726
if (object) {
726727
const bbox: SVG.BBox = object.bbox();
727728
this.onFocusRegion(bbox.x - padding, bbox.y - padding,
728-
bbox.width + padding, bbox.height + padding);
729+
bbox.width + padding * 2, bbox.height + padding * 2);
729730
}
730731
} else if (reason === UpdateReasons.SHAPE_ACTIVATED) {
731732
this.activate(this.controller.activeElement);
@@ -1014,7 +1015,26 @@ export class CanvasViewImpl implements CanvasView, Listener {
10141015
this.content.prepend(...sorted.map((pair): SVGElement => pair[0]));
10151016
}
10161017

1017-
private deactivate(): void {
1018+
private deactivateAttribute(): void {
1019+
const { clientID, attributeID } = this.activeElement;
1020+
if (clientID !== null && attributeID !== null) {
1021+
const text = this.svgTexts[clientID];
1022+
if (text) {
1023+
const [span] = text.node
1024+
.querySelectorAll(`[attrID="${attributeID}"]`) as any as SVGTSpanElement[];
1025+
if (span) {
1026+
span.style.fill = '';
1027+
}
1028+
}
1029+
1030+
this.activeElement = {
1031+
...this.activeElement,
1032+
attributeID: null,
1033+
};
1034+
}
1035+
}
1036+
1037+
private deactivateShape(): void {
10181038
if (this.activeElement.clientID !== null) {
10191039
const { clientID } = this.activeElement;
10201040
const drawnState = this.drawnStates[clientID];
@@ -1047,29 +1067,34 @@ export class CanvasViewImpl implements CanvasView, Listener {
10471067
this.sortObjects();
10481068

10491069
this.activeElement = {
1070+
...this.activeElement,
10501071
clientID: null,
1051-
attributeID: null,
10521072
};
10531073
}
10541074
}
10551075

1056-
private activate(activeElement: ActiveElement): void {
1057-
// Check if other element have been already activated
1058-
if (this.activeElement.clientID !== null) {
1059-
// Check if it is the same element
1060-
if (this.activeElement.clientID === activeElement.clientID) {
1061-
return;
1062-
}
1076+
private deactivate(): void {
1077+
this.deactivateAttribute();
1078+
this.deactivateShape();
1079+
}
10631080

1064-
// Deactivate previous element
1065-
this.deactivate();
1066-
}
1081+
private activateAttribute(clientID: number, attributeID: number): void {
1082+
const text = this.svgTexts[clientID];
1083+
if (text) {
1084+
const [span] = text.node
1085+
.querySelectorAll(`[attrID="${attributeID}"]`) as any as SVGTSpanElement[];
1086+
if (span) {
1087+
span.style.fill = 'red';
1088+
}
10671089

1068-
const { clientID } = activeElement;
1069-
if (clientID === null) {
1070-
return;
1090+
this.activeElement = {
1091+
...this.activeElement,
1092+
attributeID,
1093+
};
10711094
}
1095+
}
10721096

1097+
private activateShape(clientID: number): void {
10731098
const [state] = this.controller.objects
10741099
.filter((_state: any): boolean => _state.clientID === clientID);
10751100

@@ -1082,8 +1107,8 @@ export class CanvasViewImpl implements CanvasView, Listener {
10821107
return;
10831108
}
10841109

1085-
this.activeElement = { ...activeElement };
10861110
const shape = this.svgShapes[clientID];
1111+
10871112
let text = this.svgTexts[clientID];
10881113
if (!text) {
10891114
text = this.addText(state);
@@ -1188,6 +1213,11 @@ export class CanvasViewImpl implements CanvasView, Listener {
11881213
}
11891214
});
11901215

1216+
this.activeElement = {
1217+
...this.activeElement,
1218+
clientID,
1219+
};
1220+
11911221
this.canvas.dispatchEvent(new CustomEvent('canvas.activated', {
11921222
bubbles: false,
11931223
cancelable: true,
@@ -1197,6 +1227,30 @@ export class CanvasViewImpl implements CanvasView, Listener {
11971227
}));
11981228
}
11991229

1230+
private activate(activeElement: ActiveElement): void {
1231+
// Check if another element have been already activated
1232+
if (this.activeElement.clientID !== null) {
1233+
if (this.activeElement.clientID !== activeElement.clientID) {
1234+
// Deactivate previous shape and attribute
1235+
this.deactivate();
1236+
} else if (this.activeElement.attributeID !== activeElement.attributeID) {
1237+
this.deactivateAttribute();
1238+
}
1239+
}
1240+
1241+
const { clientID, attributeID } = activeElement;
1242+
if (clientID !== null && this.activeElement.clientID !== clientID) {
1243+
this.activateShape(clientID);
1244+
}
1245+
1246+
if (clientID !== null
1247+
&& attributeID !== null
1248+
&& this.activeElement.attributeID !== attributeID
1249+
) {
1250+
this.activateAttribute(clientID, attributeID);
1251+
}
1252+
}
1253+
12001254
// Update text position after corresponding box has been moved, resized, etc.
12011255
private updateTextPosition(text: SVG.Text, shape: SVG.Shape): void {
12021256
let box = (shape.node as any).getBBox();

cvat-core/src/annotations-collection.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,17 +802,19 @@
802802
let minimumState = null;
803803
for (const state of objectStates) {
804804
checkObjectType('object state', state, null, ObjectState);
805-
if (state.outside || state.hidden) continue;
805+
if (state.outside || state.hidden || state.objectType === ObjectType.TAG) {
806+
continue;
807+
}
806808

807809
const object = this.objects[state.clientID];
808810
if (typeof (object) === 'undefined') {
809811
throw new ArgumentError(
810812
'The object has not been saved yet. Call annotations.put([state]) before',
811813
);
812814
}
813-
814815
const distance = object.constructor.distance(state.points, x, y);
815-
if (distance !== null && (minimumDistance === null || distance < minimumDistance)) {
816+
if (distance !== null && (minimumDistance === null
817+
|| distance < minimumDistance)) {
816818
minimumDistance = distance;
817819
minimumState = state;
818820
}

cvat-core/src/annotations-filter.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
*/
99

1010
const jsonpath = require('jsonpath');
11-
const { AttributeType } = require('./enums');
11+
const {
12+
AttributeType,
13+
ObjectType,
14+
} = require('./enums');
1215
const { ArgumentError } = require('./exceptions');
1316

1417

@@ -165,18 +168,21 @@ class AnnotationsFilter {
165168
let xbr = Number.MIN_SAFE_INTEGER;
166169
let ytl = Number.MAX_SAFE_INTEGER;
167170
let ybr = Number.MIN_SAFE_INTEGER;
171+
let [width, height] = [null, null];
172+
173+
if (state.objectType !== ObjectType.TAG) {
174+
state.points.forEach((coord, idx) => {
175+
if (idx % 2) { // y
176+
ytl = Math.min(ytl, coord);
177+
ybr = Math.max(ybr, coord);
178+
} else { // x
179+
xtl = Math.min(xtl, coord);
180+
xbr = Math.max(xbr, coord);
181+
}
182+
});
183+
[width, height] = [xbr - xtl, ybr - ytl];
184+
}
168185

169-
state.points.forEach((coord, idx) => {
170-
if (idx % 2) { // y
171-
ytl = Math.min(ytl, coord);
172-
ybr = Math.max(ybr, coord);
173-
} else { // x
174-
xtl = Math.min(xtl, coord);
175-
xbr = Math.max(xbr, coord);
176-
}
177-
});
178-
179-
const [width, height] = [xbr - xtl, ybr - ytl];
180186
const attributes = {};
181187
Object.keys(state.attributes).reduce((acc, key) => {
182188
const attr = labelAttributes[key];

cvat-core/src/annotations-objects.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@
11391139
attributes: { ...this.attributes },
11401140
label: this.label,
11411141
group: this.groupObject,
1142+
color: this.color,
11421143
updated: this.updated,
11431144
frame,
11441145
};
@@ -1171,6 +1172,10 @@
11711172
this._saveLock(data.lock);
11721173
}
11731174

1175+
if (updated.color) {
1176+
this._saveColor(data.color);
1177+
}
1178+
11741179
this.updateTimestamp(updated);
11751180
updated.reset();
11761181

cvat-ui/package-lock.json

Lines changed: 9 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)