Skip to content

Commit

Permalink
Added ability to delete frames (cvat-ai#10)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitry Kalinin <[email protected]>
Co-authored-by: Nikita Manovich <[email protected]>
Co-authored-by: Boris Sekachev <[email protected]>
  • Loading branch information
4 people authored Jun 6, 2022
1 parent ff30b77 commit f960da9
Show file tree
Hide file tree
Showing 115 changed files with 21,762 additions and 38,415 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
-c 'coverage run -a manage.py test cvat/apps utils/cli -k 'tasks_id' -k 'lambda' -k 'share' && mv .coverage ${CONTAINER_COVERAGE_DATA_DIR}'
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \
-c 'cd cvat-data && npm ci && cd ../cvat-core && npm ci && npm run test && mv ./reports/coverage/lcov.info ${CONTAINER_COVERAGE_DATA_DIR} && chmod a+rwx ${CONTAINER_COVERAGE_DATA_DIR}/lcov.info'
-c 'cd cvat-data && npm ci --ignore-scripts && cd ../cvat-core && npm ci --ignore-scripts && npm run test && mv ./reports/coverage/lcov.info ${CONTAINER_COVERAGE_DATA_DIR} && chmod a+rwx ${CONTAINER_COVERAGE_DATA_DIR}/lcov.info'
- name: Uploading code coverage results as an artifact
if: github.ref == 'refs/heads/develop'
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Advanced filtration and sorting for a list of tasks/projects/cloudstorages (<https://github.com/openvinotoolkit/cvat/pull/4403>)
- Project dataset importing via chunk uploads (<https://github.com/openvinotoolkit/cvat/pull/4485>)
- Support paginated list for job commits (<https://github.com/openvinotoolkit/cvat/pull/4482>)
- Added ability to delete frames from a job (<https://github.com/openvinotoolkit/cvat/pull/4194>)

### Changed
- Added missing geos dependency into Dockerfile (<https://github.com/openvinotoolkit/cvat/pull/4451>)
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN gem install coveralls-lcov
COPY utils ${HOME}/utils
COPY cvat-core ${HOME}/cvat-core
COPY cvat-data ${HOME}/cvat-data
COPY package*.json ${HOME}/
COPY tests ${HOME}/tests

COPY .coveragerc .
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Please provide as much information as possible, including:
- Information on known exploits
- A member of the Intel Product Security Team will review your e-mail and contact you to
collaborate on resolving the issue.

For more information on how Intel works to resolve security issues, see:
[Vulnerability handling guidelines](<https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html>)

Expand Down
15 changes: 13 additions & 2 deletions cvat-canvas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,19 @@ Canvas itself handles:
}

interface Configuration {
displayAllText?: boolean;
undefinedAttrValue?: string;
smoothImage?: boolean;
autoborders?: boolean;
displayAllText?: boolean;
textFontSize?: number;
textPosition?: 'auto' | 'center';
textContent?: string;
undefinedAttrValue?: string;
showProjections?: boolean;
forceDisableEditing?: boolean;
intelligentPolygonCrop?: boolean;
forceFrameUpdate?: boolean;
creationOpacity?: number;
CSSImageFilter?: string;
}

interface DrawData {
Expand Down
169 changes: 0 additions & 169 deletions cvat-canvas/package-lock.json

This file was deleted.

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

Expand Down Expand Up @@ -237,6 +237,10 @@ polyline.cvat_canvas_shape_splitting {
-ms-interpolation-mode: nearest-neighbor; /* IE8+ */
}

.cvat_canvas_removed_image {
filter: saturate(0) brightness(1.2) contrast(0.75) !important;
}

#cvat_canvas_wrapper {
width: calc(100% - 10px);
height: calc(100% - 10px);
Expand Down
23 changes: 21 additions & 2 deletions cvat-canvas/src/typescript/canvasModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface Configuration {
intelligentPolygonCrop?: boolean;
forceFrameUpdate?: boolean;
creationOpacity?: number;
CSSImageFilter?: string;
}

export interface DrawData {
Expand Down Expand Up @@ -171,6 +172,7 @@ export enum Mode {

export interface CanvasModel {
readonly imageBitmap: boolean;
readonly imageIsDeleted: boolean;
readonly image: Image | null;
readonly issueRegions: Record<number, { hidden: boolean; points: number[] }>;
readonly objects: any[];
Expand Down Expand Up @@ -230,6 +232,7 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
imageID: number | null;
imageOffset: number;
imageSize: Size;
imageIsDeleted: boolean;
focusData: FocusData;
gridSize: Size;
left: number;
Expand Down Expand Up @@ -277,6 +280,7 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
height: 0,
width: 0,
},
imageIsDeleted: false,
focusData: {
clientID: 0,
padding: 0,
Expand Down Expand Up @@ -406,7 +410,10 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
throw Error(`Canvas is busy. Action: ${this.data.mode}`);
}
}
if (frameData.number === this.data.imageID && !this.data.configuration.forceFrameUpdate) {
if (frameData.number === this.data.imageID &&
frameData.deleted === this.data.imageIsDeleted &&
!this.data.configuration.forceFrameUpdate
) {
this.data.zLayer = zLayer;
this.data.objects = objectStates;
this.notify(UpdateReasons.OBJECTS_UPDATED);
Expand All @@ -431,6 +438,10 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
};

this.data.image = data;
this.data.imageIsDeleted = frameData.deleted;
if (this.data.imageIsDeleted) {
this.data.angle = 0;
}
this.notify(UpdateReasons.IMAGE_CHANGED);
this.data.zLayer = zLayer;
this.data.objects = objectStates;
Expand Down Expand Up @@ -476,7 +487,7 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
}

public rotate(rotationAngle: number): void {
if (this.data.angle !== rotationAngle) {
if (this.data.angle !== rotationAngle && !this.data.imageIsDeleted) {
this.data.angle = (360 + Math.floor(rotationAngle / 90) * 90) % 360;
this.fit();
}
Expand Down Expand Up @@ -695,6 +706,10 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
this.data.configuration.creationOpacity = configuration.creationOpacity;
}

if (typeof configuration.CSSImageFilter === 'string') {
this.data.configuration.CSSImageFilter = configuration.CSSImageFilter;
}

this.notify(UpdateReasons.CONFIG_UPDATED);
}

Expand Down Expand Up @@ -753,6 +768,10 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
return this.data.imageBitmap;
}

public get imageIsDeleted(): boolean {
return this.data.imageIsDeleted;
}

public get image(): Image | null {
return this.data.image;
}
Expand Down
Loading

0 comments on commit f960da9

Please sign in to comment.