Skip to content

Commit

Permalink
Merge branch 'develop' into zm/fix-mask-label-order
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Manovich authored Aug 26, 2020
2 parents 9dddebe + 2510d4d commit 49254ad
Show file tree
Hide file tree
Showing 134 changed files with 3,950 additions and 849 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Siammask tracker as DL serverless function (<https://github.com/opencv/cvat/pull/1988>)
- [Datumaro] Added model info and source info commands (<https://github.com/opencv/cvat/pull/1973>)
- [Datumaro] Dataset statistics (<https://github.com/opencv/cvat/pull/1668>)
- Ability to change label color in tasks and predefined labels (<https://github.com/opencv/cvat/pull/2014>)
- [Datumaro] Multi-dataset merge (https://github.com/opencv/cvat/pull/1695)
- Ability to configure email verification for new users (<https://github.com/opencv/cvat/pull/1929>)
- Link to django admin page from UI (<https://github.com/opencv/cvat/pull/2068>)
- Notification message when users use wrong browser (<https://github.com/opencv/cvat/pull/2070>)

### Changed
- Shape coordinates are rounded to 2 digits in dumped annotations (<https://github.com/opencv/cvat/pull/1970>)
Expand All @@ -24,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Issue loading openvino models for semi-automatic and automatic annotation (<https://github.com/opencv/cvat/pull/1996>)
- Basic functions of CVAT works without activated nuclio dashboard
- Fixed a case in which exported masks could have wrong color order (<https://github.com/opencv/cvat/issues/2032>)
- Fixed error with creating task with labels with the same name (<https://github.com/opencv/cvat/pull/2031>)
- Django RQ dashboard view (<https://github.com/opencv/cvat/pull/2069>)

### Security
-
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ RUN apt-get update && \
curl && \
curl https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get --no-install-recommends install -y git-lfs && git lfs install && \
python3 -m pip install --no-cache-dir -U pip==20.0.1 setuptools>=49.1.0 && \
python3 -m pip install --no-cache-dir -U pip==20.0.1 setuptools>=49.1.0 wheel==0.35.1 && \
ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
add-apt-repository --remove ppa:mc3man/gstffmpeg-keep -y && \
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.ui
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ COPY cvat-canvas/package*.json /tmp/cvat-canvas/
COPY cvat-ui/package*.json /tmp/cvat-ui/
COPY cvat-data/package*.json /tmp/cvat-data/

RUN npm config set loglevel info

# Install cvat-data dependencies
WORKDIR /tmp/cvat-data/
RUN npm install
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/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-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-core",
"version": "3.4.0",
"version": "3.5.0",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js",
"scripts": {
Expand Down
6 changes: 4 additions & 2 deletions cvat-core/src/api-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@

cvat.server.register.implementation = async (username, firstName, lastName,
email, password1, password2, userConfirmations) => {
await serverProxy.server.register(username, firstName, lastName, email,
password1, password2, userConfirmations);
const user = await serverProxy.server.register(username, firstName,
lastName, email, password1, password2, userConfirmations);

return new User(user);
};

cvat.server.login.implementation = async (username, password) => {
Expand Down
1 change: 1 addition & 0 deletions cvat-core/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ function build() {
* @param {string} password1 A password for the new account
* @param {string} password2 The confirmation password for the new account
* @param {Object} userConfirmations An user confirmations of terms of use if needed
* @returns {Object} response data
* @throws {module:API.cvat.exceptions.PluginError}
* @throws {module:API.cvat.exceptions.ServerError}
*/
Expand Down
9 changes: 3 additions & 6 deletions cvat-core/src/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
(() => {
const {
AttributeType,
colors,
} = require('./enums');
const { ArgumentError } = require('./exceptions');

Expand Down Expand Up @@ -150,9 +149,6 @@
}
}

if (typeof (data.id) !== 'undefined') {
data.color = colors[data.id % colors.length];
}
data.attributes = [];

if (Object.prototype.hasOwnProperty.call(initialData, 'attributes')
Expand Down Expand Up @@ -193,10 +189,10 @@
color: {
get: () => data.color,
set: (color) => {
if (colors.includes(color)) {
if (typeof color === 'string' && color.match(/^#[0-9a-f]{6}$|^$/)) {
data.color = color;
} else {
throw new ArgumentError('Trying to set unknown color');
throw new ArgumentError('Trying to set wrong color format');
}
},
},
Expand All @@ -217,6 +213,7 @@
const object = {
name: this.name,
attributes: [...this.attributes.map((el) => el.toJSON())],
color: this.color,
};

if (typeof (this.id) !== 'undefined') {
Expand Down
11 changes: 11 additions & 0 deletions cvat-core/src/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
is_staff: null,
is_superuser: null,
is_active: null,
email_verification_required: null,
};

for (const property in data) {
Expand Down Expand Up @@ -143,6 +144,16 @@
*/
get: () => data.is_active,
},
isVerified: {
/**
* @name isVerified
* @type {boolean}
* @memberof module:API.cvat.classes.User
* @readonly
* @instance
*/
get: () => !data.email_verification_required,
},
}));
}
}
Expand Down
2 changes: 1 addition & 1 deletion cvat-data/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-data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-data",
"version": "1.0.0",
"version": "1.0.1",
"description": "",
"main": "src/js/cvat-data.js",
"devDependencies": {
Expand Down
21 changes: 20 additions & 1 deletion cvat-data/src/js/cvat-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,26 @@ class FrameProvider {
worker.terminate();
};

worker.onmessage = (event) => {
worker.onmessage = async (event) => {
if (event.data.isRaw) {
// safary doesn't support createImageBitmap
// there is a way to polyfill it with using document.createElement
// but document.createElement doesn't work in worker
// so, we get raw data and decode it here, no other way

const createImageBitmap = async function(blob) {
return new Promise((resolve,reject) => {
let img = document.createElement('img');
img.addEventListener('load', function() {
resolve(this);
});
img.src = URL.createObjectURL(blob);
});
};

event.data.data = await createImageBitmap(event.data.data);
}

this._frames[event.data.index] = event.data.data;

if (this._decodingBlocks[`${start}:${end}`].resolveCallback) {
Expand Down
15 changes: 12 additions & 3 deletions cvat-data/src/js/unzip_imgs.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,22 @@ onmessage = (e) => {
const fileIndex = index++;
if (fileIndex <= end) {
_zip.file(relativePath).async('blob').then((fileData) => {
createImageBitmap(fileData).then((img) => {
if (self.createImageBitmap) {
createImageBitmap(fileData).then((img) => {
postMessage({
fileName: relativePath,
index: fileIndex,
data: img,
});
});
} else {
postMessage({
fileName: relativePath,
index: fileIndex,
data: img,
data: fileData,
isRaw: true,
});
});
}
});
}
});
Expand Down
Loading

0 comments on commit 49254ad

Please sign in to comment.