Skip to content

Commit

Permalink
Merge branch 'develop' into kl/requests-crush-test
Browse files Browse the repository at this point in the history
  • Loading branch information
klakhov committed Oct 29, 2024
2 parents b656668 + 9982156 commit 94ef56c
Show file tree
Hide file tree
Showing 17 changed files with 167 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.9'

- name: Download CVAT server image
uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.9'

- name: Download CVAT server image
uses: actions/download-artifact@v4
Expand Down
133 changes: 48 additions & 85 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ on:
workflow_dispatch:

env:
SERVER_IMAGE_TEST_REPO: cvat_server
UI_IMAGE_TEST_REPO: instrumentation_cvat_ui
CYPRESS_VERIFY_TIMEOUT: 180000 # https://docs.cypress.io/guides/guides/command-line#cypress-verify
CVAT_VERSION: "local"

jobs:
check_updates:
Expand Down Expand Up @@ -48,12 +47,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_CI_USERNAME }}
password: ${{ secrets.DOCKERHUB_CI_TOKEN }}

- name: CVAT server. Getting cache from the default branch
uses: actions/cache@v4
with:
Expand All @@ -66,44 +59,44 @@ jobs:
path: /tmp/cvat_cache_ui
key: ${{ runner.os }}-build-ui-${{ needs.search_cache.outputs.sha }}

- name: CVAT server. Extract metadata (tags, labels) for Docker
id: meta-server
uses: docker/metadata-action@master
with:
images: ${{ secrets.DOCKERHUB_CI_WORKSPACE }}/${{ env.SERVER_IMAGE_TEST_REPO }}
tags:
type=raw,value=nightly

- name: CVAT UI. Extract metadata (tags, labels) for Docker
id: meta-ui
uses: docker/metadata-action@master
with:
images: ${{ secrets.DOCKERHUB_CI_WORKSPACE }}/${{ env.UI_IMAGE_TEST_REPO }}
tags:
type=raw,value=nightly

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Create artifact directories
run: |
mkdir /tmp/cvat_server
mkdir /tmp/cvat_ui
mkdir /tmp/cvat_sdk
- name: CVAT server. Build and push
uses: docker/build-push-action@v6
with:
cache-from: type=local,src=/tmp/cvat_cache_server
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta-server.outputs.tags }}
labels: ${{ steps.meta-server.outputs.labels }}
tags: cvat/server:${{ env.CVAT_VERSION }}
outputs: type=docker,dest=/tmp/cvat_server/image.tar

- name: CVAT UI. Build and push
uses: docker/build-push-action@v6
with:
cache-from: type=local,src=/tmp/cvat_cache_ui
context: .
file: Dockerfile.ui
push: true
tags: ${{ steps.meta-ui.outputs.tags }}
labels: ${{ steps.meta-ui.outputs.labels }}
tags: cvat/ui:${{ env.CVAT_VERSION }}
outputs: type=docker,dest=/tmp/cvat_ui/image.tar

- name: Upload CVAT server artifact
uses: actions/upload-artifact@v4
with:
name: cvat_server
path: /tmp/cvat_server/image.tar

- name: Upload CVAT UI artifact
uses: actions/upload-artifact@v4
with:
name: cvat_ui
path: /tmp/cvat_ui/image.tar

unit_testing:
needs: build
Expand All @@ -113,43 +106,25 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.9'

- name: Getting CVAT UI cache from the default branch
uses: actions/cache@v4
- name: Download CVAT server image
uses: actions/download-artifact@v4
with:
path: /tmp/cvat_cache_ui
key: ${{ runner.os }}-build-ui-${{ needs.search_cache.outputs.sha }}
name: cvat_server
path: /tmp/cvat_server/

- name: Building CVAT UI image
uses: docker/build-push-action@v6
- name: Download CVAT UI images
uses: actions/download-artifact@v4
with:
context: .
file: ./Dockerfile.ui
cache-from: type=local,src=/tmp/cvat_cache_ui
tags: cvat/ui:latest
load: true
name: cvat_ui
path: /tmp/cvat_ui/

- name: CVAT server. Extract metadata (tags, labels) for Docker
id: meta-server
uses: docker/metadata-action@master
with:
images: ${{ secrets.DOCKERHUB_CI_WORKSPACE }}/${{ env.SERVER_IMAGE_TEST_REPO }}
tags:
type=raw,value=nightly

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_CI_USERNAME }}
password: ${{ secrets.DOCKERHUB_CI_TOKEN }}

- name: Pull CVAT server image
- name: Load Docker images
run: |
docker pull ${{ steps.meta-server.outputs.tags }}
docker tag ${{ steps.meta-server.outputs.tags }} cvat/server:local
docker tag ${{ steps.meta-server.outputs.tags }} cvat/server:latest
docker tag cvat/ui:latest cvat/ui:local
docker load --input /tmp/cvat_server/image.tar
docker load --input /tmp/cvat_ui/image.tar
docker image ls -a
- name: OPA tests
run: |
Expand Down Expand Up @@ -210,35 +185,23 @@ jobs:
with:
node-version: '16.x'

- name: Login to Docker Hub
uses: docker/login-action@v3
- name: Download CVAT server image
uses: actions/download-artifact@v4
with:
username: ${{ secrets.DOCKERHUB_CI_USERNAME }}
password: ${{ secrets.DOCKERHUB_CI_TOKEN }}
name: cvat_server
path: /tmp/cvat_server/

- name: CVAT server. Extract metadata (tags, labels) for Docker
id: meta-server
uses: docker/metadata-action@master
- name: Download CVAT UI image
uses: actions/download-artifact@v4
with:
images: ${{ secrets.DOCKERHUB_CI_WORKSPACE }}/${{ env.SERVER_IMAGE_TEST_REPO }}
tags:
type=raw,value=nightly
name: cvat_ui
path: /tmp/cvat_ui/

- name: CVAT UI. Extract metadata (tags, labels) for Docker
id: meta-ui
uses: docker/metadata-action@master
with:
images: ${{ secrets.DOCKERHUB_CI_USERNAME }}/${{ env.UI_IMAGE_TEST_REPO }}
tags:
type=raw,value=nightly

- name: Pull CVAT UI image
- name: Load Docker images
run: |
docker pull ${{ steps.meta-server.outputs.tags }}
docker tag ${{ steps.meta-server.outputs.tags }} cvat/server:dev
docker pull ${{ steps.meta-ui.outputs.tags }}
docker tag ${{ steps.meta-ui.outputs.tags }} cvat/ui:dev
docker load --input /tmp/cvat_server/image.tar
docker load --input /tmp/cvat_ui/image.tar
docker image ls -a
- name: Run CVAT instance
run: |
Expand Down
7 changes: 7 additions & 0 deletions changelog.d/20241023_120236_klakhov_improve_gt_tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Fixed

- Tags in ground truth job were displayed as `tag (GT)`
(<https://github.com/cvat-ai/cvat/pull/8586>)

- Tags in ground truth job couldn't be deleted via `x` button
(<https://github.com/cvat-ai/cvat/pull/8586>)
4 changes: 4 additions & 0 deletions changelog.d/20241028_140908_sekachev.bs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Exception 'Canvas is busy' when change frame during drag/resize a track
(<https://github.com/cvat-ai/cvat/pull/8598>)
4 changes: 4 additions & 0 deletions changelog.d/20241028_140945_sekachev.bs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- A shape gets shifted if auto save triggered during dragging
(<https://github.com/cvat-ai/cvat/pull/8598>)
4 changes: 4 additions & 0 deletions changelog.d/20241029_113229_maria_drop_python_3_8_support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Removed

- Dropped support for Python 3.8 since its EOL was on 2024-10-07
(<https://github.com/cvat-ai/cvat/pull/8360>)
55 changes: 53 additions & 2 deletions cvat-canvas/src/typescript/canvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,53 @@ export class CanvasViewImpl implements CanvasView, Listener {
this.canvas.dispatchEvent(event);
}

private resetViewPosition(clientID: number): void {
const drawnState = this.drawnStates[clientID];
const drawnShape = this.svgShapes[clientID];

if (drawnState && drawnShape) {
const { shapeType, points } = drawnState;
const translatedPoints: number[] = this.translateToCanvas(points);
const stringified = stringifyPoints(translatedPoints);
if (shapeType === 'cuboid') {
drawnShape.attr('points', stringified);
} else if (['polygon', 'polyline', 'points'].includes(shapeType)) {
(drawnShape as SVG.PolyLine | SVG.Polygon).plot(stringified);
if (shapeType === 'points') {
this.selectize(false, drawnShape);
this.setupPoints(drawnShape as SVG.PolyLine, drawnState);
}
} else if (shapeType === 'rectangle') {
const [xtl, ytl, xbr, ybr] = translatedPoints;
drawnShape.rotate(0);
drawnShape.size(xbr - xtl, ybr - ytl).move(xtl, ytl);
drawnShape.rotate(drawnState.rotation);
} else if (shapeType === 'ellipse') {
const [cx, cy, rightX, topY] = translatedPoints;
const [rx, ry] = [rightX - cx, cy - topY];
drawnShape.rotate(0);
drawnShape.size(rx * 2, ry * 2).center(cx, cy);
drawnShape.rotate(drawnState.rotation);
} else if (shapeType === 'skeleton') {
drawnShape.rotate(0);
for (const child of (drawnShape as SVG.G).children()) {
if (child.type === 'circle') {
const childClientID = child.attr('data-client-id');
const element = drawnState.elements.find((el: any) => el.clientID === childClientID);
const [x, y] = this.translateToCanvas(element.points);
child.center(x, y);
}
}
drawnShape.rotate(drawnState.rotation);
} else if (shapeType === 'mask') {
const [left, top] = points.slice(-4);
drawnShape.move(this.geometry.offset + left, this.geometry.offset + top);
} else {
throw new Error('Not implemented');
}
}
}

private onInteraction = (
shapes: InteractionResult[] | null,
shapesUpdated = true,
Expand Down Expand Up @@ -1114,6 +1161,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
}
}).on('dragend', (e: CustomEvent): void => {
if (aborted) {
this.resetViewPosition(state.clientID);
return;
}

Expand Down Expand Up @@ -1172,6 +1220,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
this.draggableShape = null;
aborted = true;
// disable internal drag events of SVG.js
// call chain is (mouseup -> SVG.handler.end -> SVG.handler.drag -> dragend)
window.dispatchEvent(new MouseEvent('mouseup'));
});
} else {
Expand Down Expand Up @@ -1303,6 +1352,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
})
.on('resizedone', (): void => {
if (aborted) {
this.resetViewPosition(state.clientID);
return;
}

Expand Down Expand Up @@ -1359,7 +1409,8 @@ export class CanvasViewImpl implements CanvasView, Listener {
onResizeEnd();
aborted = true;
this.resizableShape = null;
// disable internal drag events of SVG.js
// disable internal resize events of SVG.js
// call chain is (mouseup -> SVG.handler.end -> SVG.handler.resize-> resizeend)
window.dispatchEvent(new MouseEvent('mouseup'));
});
} else {
Expand Down Expand Up @@ -3401,7 +3452,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
return skeleton;
}

private setupPoints(basicPolyline: SVG.PolyLine, state: any): any {
private setupPoints(basicPolyline: SVG.PolyLine, state: any | DrawnState): any {
this.selectize(true, basicPolyline);

const group: SVG.G = basicPolyline
Expand Down
2 changes: 1 addition & 1 deletion cvat-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def parse_requirements(filename=BASE_REQUIREMENTS_FILE):
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.8",
python_requires=">=3.9",
install_requires=BASE_REQUIREMENTS,
entry_points={
"console_scripts": [
Expand Down
2 changes: 1 addition & 1 deletion cvat-sdk/gen/generator-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ additionalProperties:
packageName: "cvat_sdk.api_client"
initRequiredVars: true
generateSourceCodeOnly: false
generatorLanguageVersion: '>=3.8'
generatorLanguageVersion: '>=3.9'
globalProperties:
generateAliasAsModel: true
apiTests: false
Expand Down
Loading

0 comments on commit 94ef56c

Please sign in to comment.