Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes: Propagation from the latest frame, number attribute validation #1800

Merged
merged 3 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- 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>)
- 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>)


### Security
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.0.1",
"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
2 changes: 1 addition & 1 deletion cvat-ui/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-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.4.0",
"version": "1.4.1",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
18 changes: 12 additions & 6 deletions cvat-ui/src/components/labels-editor/label-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,21 +239,27 @@ class LabelForm extends React.PureComponent<Props, {}> {
.split(';')
.map((number): number => Number.parseFloat(number));
if (numbers.length !== 3) {
callback('Invalid input');
callback('Three numbers are expected');
}

for (const number of numbers) {
if (Number.isNaN(number)) {
callback('Invalid input');
callback(`"${number}" is not a number`);
}
}

if (numbers[0] >= numbers[1]) {
callback('Invalid input');
const [min, max, step] = numbers;

if (min >= max) {
callback('Minimum must be less than maximum');
}

if (max - min < step) {
callback('Step must be less than minmax difference');
}

if (+numbers[1] - +numbers[0] < +numbers[2]) {
callback('Invalid input');
if (step <= 0) {
callback('Step must be a positive number');
}

callback();
Expand Down