Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Browse files Browse the repository at this point in the history
…o dkru/update-test-case-5-add-scale
  • Loading branch information
dvkruchinin committed Feb 2, 2021
2 parents ccbb741 + 7348a95 commit e7944f1
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed filters select overflow (<https://github.com/openvinotoolkit/cvat/pull/2614>)
- Fixed tasks in project autoannotation (<https://github.com/openvinotoolkit/cvat/pull/2725>)
- Cuboids are missed in annotations statistics (<https://github.com/openvinotoolkit/cvat/pull/2704>)
- The list of files attached to the task is not displayed (<https://github.com/openvinotoolkit/cvat/pull/2706>)
- The list of files attached to the task is not displayed (<https://github.com/openvinotoolkit/cvat/pul
- A couple of css-related issues (top bar disappear, wrong arrow position on collapse elements) (<https://github.com/openvinotoolkit/cvat/pull/2736>)
- Issue with point region doesn't work in Firefox (<https://github.com/openvinotoolkit/cvat/pull/2727>)

### Security

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": "2.2.1",
"version": "2.2.2",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions cvat-canvas/src/typescript/regionSelector.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2020-2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -66,7 +66,7 @@ export class RegionSelectorImpl implements RegionSelector {
'stroke-width': consts.BASE_STROKE_WIDTH / this.geometry.scale,
})
.addClass('cvat_canvas_shape_region_selection');
this.selectionRect.attr({ ...this.startSelectionPoint });
this.selectionRect.attr({ ...this.startSelectionPoint, width: 1, height: 1 });
}
};

Expand All @@ -78,7 +78,7 @@ export class RegionSelectorImpl implements RegionSelector {
} = this.selectionRect.bbox();
this.selectionRect.remove();
this.selectionRect = null;
if (w === 0 && h === 0) {
if (w <= 1 && h <= 1) {
this.onRegionSelected([x - offset, y - offset]);
} else {
this.onRegionSelected([x - offset, y - offset, x2 - offset, y2 - offset]);
Expand Down
4 changes: 2 additions & 2 deletions cvat/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ django-compressor==2.4
django-rq==2.3.2
EasyProcess==0.3
Pillow==7.2.0
numpy==1.19.2
numpy==1.20.0
python-ldap==3.3.1
pytz==2020.1
pyunpack==0.2.1
Expand Down Expand Up @@ -39,7 +39,7 @@ h5py==2.10.0
django-cors-headers==3.5.0
furl==2.1.0
av==8.0.2 --no-binary=av
tensorflow==2.4.0 # Optional requirement of Datumaro
tensorflow==2.4.1 # Optional requirement of Datumaro
# The package is used by pyunpack as a command line tool to support multiple
# archives. Don't use as a python module because it has GPL license.
patool==1.12
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

/// <reference types="cypress" />

import { taskName, labelName } from '../../support/const';

context('Annotations statistics.', () => {
const caseId = '48';
const issueId = '2663';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
secondY: 450,
};
const createRectangleTrack2Points = {
points: 'By 2 Points',
type: 'Track',
labelName: labelName,
firstX: createRectangleShape2Points.firstX,
firstY: createRectangleShape2Points.firstY - 150,
secondX: createRectangleShape2Points.secondX,
secondY: createRectangleShape2Points.secondY - 150,
};
const createCuboidShape2Points = {
points: 'From rectangle',
type: 'Shape',
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
secondY: 450,
};
const createCuboidTrack2Points = {
points: 'From rectangle',
type: 'Track',
labelName: labelName,
firstX: createCuboidShape2Points.firstX,
firstY: createCuboidShape2Points.firstY + 150,
secondX: createCuboidShape2Points.secondX,
secondY: createCuboidShape2Points.secondY + 150,
};
const createPolygonShape = {
reDraw: false,
type: 'Shape',
labelName: labelName,
pointsMap: [
{ x: 100, y: 100 },
{ x: 150, y: 100 },
{ x: 150, y: 150 },
],
complete: true,
numberOfPoints: null,
};
const createPolygonTrack = {
reDraw: false,
type: 'Track',
labelName: labelName,
pointsMap: [
{ x: 200, y: 100 },
{ x: 250, y: 100 },
{ x: 250, y: 150 },
],
complete: true,
numberOfPoints: null,
};
const createPolylinesShape = {
type: 'Shape',
labelName: labelName,
pointsMap: [
{ x: 300, y: 100 },
{ x: 350, y: 100 },
{ x: 350, y: 150 },
],
complete: true,
numberOfPoints: null,
};
const createPolylinesTrack = {
type: 'Track',
labelName: labelName,
pointsMap: [
{ x: 400, y: 100 },
{ x: 450, y: 100 },
{ x: 450, y: 150 },
],
complete: true,
numberOfPoints: null,
};
const createPointsShape = {
type: 'Shape',
labelName: labelName,
pointsMap: [{ x: 200, y: 400 }],
complete: true,
numberOfPoints: null,
};
const createPointsTrack = {
type: 'Track',
labelName: labelName,
pointsMap: [{ x: 300, y: 400 }],
complete: true,
numberOfPoints: null,
};

before(() => {
cy.openTaskJob(taskName);
cy.createRectangle(createRectangleShape2Points);
cy.createRectangle(createRectangleTrack2Points);
cy.createTag(labelName);
cy.goToNextFrame(1);
cy.createCuboid(createCuboidShape2Points);
cy.createCuboid(createCuboidTrack2Points);
cy.goToNextFrame(2);
cy.createPolygon(createPolygonShape);
cy.createPolygon(createPolygonTrack);
cy.goToNextFrame(3);
cy.createPolyline(createPolylinesShape);
cy.createPolyline(createPolylinesTrack);
cy.goToNextFrame(4);
cy.createPoint(createPointsShape);
cy.createPoint(createPointsTrack);
});

describe(`Testing case "${caseId}"`, () => {
it('Open annotation statistics.', () => {
cy.contains('.cvat-annotation-header-button', 'Info').click();
cy.get('.cvat-job-info-modal-window').should('be.visible');
});

it(`Check issue ${issueId}`, () => {
// Issue 2663: "Cuboids are missed in annotations statistics"
const objectTypes = ['Rectangle', 'Polygon', 'Polyline', 'Points', 'Cuboids', 'Tags'];
cy.get('.cvat-job-info-statistics')
.find('table')
.first()
.find('tr')
.then((jobInfoTableHeader) => {
cy.get(jobInfoTableHeader)
.find('th')
.then((jobInfoTableHeaderColumns) => {
jobInfoTableHeaderColumns = Array.from(jobInfoTableHeaderColumns);
const elTextContent = jobInfoTableHeaderColumns.map((el) =>
el.textContent.replace(/\s/g, ''),
); // Removing spaces. For example: " Tags ". In Firefox, this causes an error.
for (let i = 0; i < objectTypes.length; i++) {
expect(elTextContent).to.include(objectTypes[i]); // expected [ Array(11) ] to include Cuboids, etc.
}
});
});
});

it('Annotation statistics shows valid results.', () => {
cy.get('.cvat-job-info-statistics')
.find('table')
.last()
.within(() => {
cy.contains(labelName)
.parents('tr')
.find('td')
.then((tableBodyFirstRowThs) => {
tableBodyFirstRowThs = Array.from(tableBodyFirstRowThs);
const elTextContent = tableBodyFirstRowThs.map((el) => el.textContent);
expect(elTextContent[0]).to.be.equal(labelName);
for (let i = 1; i < 6; i++) {
expect(elTextContent[i]).to.be.equal('1 / 1'); // Rectangle, Polygon, Polyline, Points, Cuboids
}
expect(elTextContent[6]).to.be.equal('1'); // Tags
expect(elTextContent[7]).to.be.equal('11'); // Manually
expect(elTextContent[8]).to.be.equal('35'); // Interpolated
expect(elTextContent[9]).to.be.equal('46'); // Total
});
});
cy.contains('[type="button"]', 'OK').click();
cy.get('.cvat-job-info-modal-window').should('not.be.visible');
});
});
});

0 comments on commit e7944f1

Please sign in to comment.