Skip to content

Commit

Permalink
Merge branch 'develop' into mk/fix-cs-deletion-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Marishka17 authored Nov 23, 2023
2 parents b1ab921 + 791ba7f commit 2616210
Show file tree
Hide file tree
Showing 24 changed files with 322 additions and 309 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ jobs:
COVERAGE_PROCESS_START: ".coveragerc"
run: |
pytest tests/python/ --cov --cov-report=json
for COVERAGE_FILE in `find -name "coverage*.json" -type f -printf "%f\n"`; do mv ${COVERAGE_FILE} "${COVERAGE_FILE%%.*}_0.json"; done
ONE_RUNNING_JOB_IN_QUEUE_PER_USER="true" pytest tests/python/rest_api/test_queues.py --cov --cov-report=json
- name: Uploading code coverage results as an artifact
uses: actions/upload-artifact@v3.1.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Removed

- Support for V1 cloudstorages/id/content endpoint
(<https://github.com/opencv/cvat/pull/6946>)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Job state can not be changed many time without reloading annotation view.
(<https://github.com/opencv/cvat/pull/7158>)
4 changes: 4 additions & 0 deletions changelog.d/20231122_111559_sekachev.bs_fixed_exif.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Compressed chunks do not use exif rotation tag
(<https://github.com/opencv/cvat/pull/7162>)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Minor styling issues on empty models page
(<https://github.com/opencv/cvat/pull/7164>)
4 changes: 4 additions & 0 deletions changelog.d/20231123_093015_sekachev.bs_fixed_drawn_marker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Fixed minor issue when brush marker is appended to a final mask
(<https://github.com/opencv/cvat/pull/7168>)
2 changes: 2 additions & 0 deletions cvat-canvas/src/typescript/masksHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ export class MasksHandlerImpl implements MasksHandler {
try {
if (this.drawnObjects.length) {
const wrappingBbox = this.getDrawnObjectsWrappingBox();
this.removeBrushMarker(); // remove brush marker from final mask
const imageData = this.imageDataFromCanvas(wrappingBbox);
const rle = zipChannels(imageData);
rle.push(wrappingBbox.left, wrappingBbox.top, wrappingBbox.right, wrappingBbox.bottom);
Expand Down Expand Up @@ -629,6 +630,7 @@ export class MasksHandlerImpl implements MasksHandler {
try {
if (this.drawnObjects.length) {
const wrappingBbox = this.getDrawnObjectsWrappingBox();
this.removeBrushMarker(); // remove brush marker from final mask
const imageData = this.imageDataFromCanvas(wrappingBbox);
const rle = zipChannels(imageData);
rle.push(wrappingBbox.left, wrappingBbox.top, wrappingBbox.right, wrappingBbox.bottom);
Expand Down
12 changes: 12 additions & 0 deletions cvat-core/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ export class Job extends Session {
assignee: {
get: () => data.assignee,
set: (assignee) => {
if ((assignee?.id || null) === (data.assignee?.id || null)) {
return;
}

if (assignee !== null && !(assignee instanceof User)) {
throw new ArgumentError('Value must be a user instance');
}
Expand All @@ -469,6 +473,10 @@ export class Job extends Session {
stage: {
get: () => data.stage,
set: (stage) => {
if (stage === data.stage) {
return;
}

const type = JobStage;
let valueInEnum = false;
for (const value in type) {
Expand All @@ -491,6 +499,10 @@ export class Job extends Session {
state: {
get: () => data.state,
set: (state) => {
if (state === data.state) {
return;
}

const type = JobState;
let valueInEnum = false;
for (const value in type) {
Expand Down
47 changes: 24 additions & 23 deletions cvat-ui/src/components/models-page/empty-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,29 @@ import config from 'config';

export default function EmptyListComponent(): JSX.Element {
return (
<Empty
className='cvat-empty-models-list'
description={(
<div>
<Row justify='center' align='middle'>
<Col>
<Text strong>No models deployed yet...</Text>
</Col>
</Row>
<Row justify='center' align='middle'>
<Col>
<Text type='secondary'>To annotate your tasks automatically</Text>
</Col>
</Row>
<Row justify='center' align='middle'>
<Col>
<Text type='secondary'>deploy a model with </Text>
<a href={`${config.NUCLIO_GUIDE}`}>nuclio</a>
</Col>
</Row>
</div>
)}
/>
<div className='cvat-empty-models-list'>
<Empty
description={(
<div>
<Row justify='center' align='middle'>
<Col>
<Text strong>No models deployed yet...</Text>
</Col>
</Row>
<Row justify='center' align='middle'>
<Col>
<Text type='secondary'>To annotate your tasks automatically</Text>
</Col>
</Row>
<Row justify='center' align='middle'>
<Col>
<Text type='secondary'>deploy a model with </Text>
<a href={`${config.NUCLIO_GUIDE}`}>nuclio</a>
</Col>
</Row>
</div>
)}
/>
</div>
);
}
21 changes: 13 additions & 8 deletions cvat-ui/src/components/models-page/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@
padding-top: $grid-unit-size * 2;
padding-bottom: $grid-unit-size;
overflow: auto;
position: fixed;
height: 100%;
width: 100%;

.cvat-models-page-top-bar {
padding-bottom: $grid-unit-size;
}

>div:nth-child(2) {
height: 80%;
&:not(.cvat-empty-models-list) {
height: 90%;
}
}
}

.cvat-empty-models-list {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.ant-empty {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}

.cvat-models-list {
Expand Down Expand Up @@ -68,8 +75,6 @@
}

.cvat-models-page-top-bar {
margin: $grid-unit-size * 3 0;

.cvat-models-page-search-bar {
width: $grid-unit-size * 32;
padding-left: $grid-unit-size * 0.5;
Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/engine/media_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ def _compress_image(source_image: av.VideoFrame | io.IOBase | Image.Image, quali
with Image.open(source_image) as _img:
image = ImageOps.exif_transpose(_img)
elif isinstance(source_image, Image.Image):
image = source_image
image = ImageOps.exif_transpose(source_image)

assert image is not None

Expand Down
52 changes: 0 additions & 52 deletions cvat/apps/engine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
OpenApiParameter, OpenApiResponse, PolymorphicProxySerializer,
extend_schema_view, extend_schema
)
from drf_spectacular.plumbing import build_array_type, build_basic_type

from pathlib import Path
from rest_framework import mixins, serializers, status, viewsets
Expand Down Expand Up @@ -2483,57 +2482,6 @@ def create(self, request, *args, **kwargs):
response = HttpResponseBadRequest(str(ex))
return response

@extend_schema(summary='Method returns a manifest content',
parameters=[
OpenApiParameter('manifest_path', description='Path to the manifest file in a cloud storage',
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR),
],
responses={
'200': OpenApiResponse(response=build_array_type(build_basic_type(OpenApiTypes.STR)), description='A manifest content'),
},
deprecated=True,
description="This method is deprecated and will be removed in version 2.6.0. "
"Please use the new version of API: /cloudstorages/id/content-v2/",
)
@action(detail=True, methods=['GET'], url_path='content')
def content(self, request, pk):
storage = None
try:
db_storage = self.get_object()
storage = db_storage_to_storage_instance(db_storage)
if not db_storage.manifests.count():
raise ValidationError('There is no manifest file')
manifest_path = request.query_params.get('manifest_path', db_storage.manifests.first().filename)
manifest_prefix = os.path.dirname(manifest_path)

full_manifest_path = os.path.join(db_storage.get_storage_dirname(), manifest_path)
if not os.path.exists(full_manifest_path) or \
datetime.fromtimestamp(os.path.getmtime(full_manifest_path), tz=timezone.utc) < storage.get_file_last_modified(manifest_path):
storage.download_file(manifest_path, full_manifest_path)
manifest = ImageManifestManager(full_manifest_path, db_storage.get_storage_dirname())
# need to update index
manifest.set_index()
manifest_files = [os.path.join(manifest_prefix, f) for f in manifest.data]
return Response(
data=manifest_files,
content_type='text/plain',
headers={'Deprecation': 'true'}
)

except CloudStorageModel.DoesNotExist:
message = f"Storage {pk} does not exist"
slogger.glob.error(message)
return HttpResponseNotFound(message)
except (ValidationError, PermissionDenied, NotFound) as ex:
msg = str(ex) if not isinstance(ex, ValidationError) else \
'\n'.join([str(d) for d in ex.detail])
slogger.cloud_storage[pk].info(msg)
return Response(data=msg, status=ex.status_code)
except Exception as ex:
slogger.glob.error(str(ex))
return Response("An internal error has occurred",
status=status.HTTP_500_INTERNAL_SERVER_ERROR)

@extend_schema(summary='Method returns the content of the cloud storage',
parameters=[
OpenApiParameter('manifest_path', description='Path to the manifest file in a cloud storage',
Expand Down
36 changes: 0 additions & 36 deletions cvat/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -767,42 +767,6 @@ paths:
schema:
type: string
description: Cloud Storage actions (GET | PUT | DELETE)
/api/cloudstorages/{id}/content:
get:
operationId: cloudstorages_retrieve_content
description: 'This method is deprecated and will be removed in version 2.6.0.
Please use the new version of API: /cloudstorages/id/content-v2/'
summary: Method returns a manifest content
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this cloud storage.
required: true
- in: query
name: manifest_path
schema:
type: string
description: Path to the manifest file in a cloud storage
tags:
- cloudstorages
security:
- sessionAuth: []
csrfAuth: []
tokenAuth: []
- signatureAuth: []
- basicAuth: []
deprecated: true
responses:
'200':
content:
application/vnd.cvat+json:
schema:
type: array
items:
type: string
description: A manifest content
/api/cloudstorages/{id}/content-v2:
get:
operationId: cloudstorages_retrieve_content_v2
Expand Down
72 changes: 0 additions & 72 deletions site/content/en/docs/getting_started/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,3 @@ title: 'Getting started'
linkTitle: 'Getting started'
weight: 1
---

This section contains basic information and links to sections necessary for a quick start.

## Installation

First step is to install CVAT on your system:

- [Installation on Ubuntu](/docs/administration/basics/installation/#ubuntu-1804-x86_64amd64)
- [Installation on Windows 10](/docs/administration/basics/installation/#windows-10)
- [Installation on Mac OS](/docs/administration/basics/installation/#mac-os-mojave)

To learn how to create a superuser and log in to CVAT,
go to the [authorization](/docs/manual/basics/authorization/) section.

## Getting started in CVAT

To create a task, go to `Tasks` section. Click `Create new task` to go to the task creation page.

Set the name of the future task.

Set the label using the constructor: first click `Add label`, then enter the name of the label and choose the color.

![](/images/create_a_new_task.gif)

You need to upload images or videos for your future annotation. To do so, simply drag and drop the files.

To learn more, go to [creating an annotation task](/docs/manual/basics/creating_an_annotation_task/)

## Annotation

### Basic

When the task is created, you will see a corresponding message in the top right corner.
Click the `Open task` button to go to the task page.

Once on the task page, open a link to the job in the jobs list.

Choose a correct section for your type of the task and start annotation.

| Shape | Annotation | Interpolation |
| --------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| Rectangle | [Shape mode (basics)](/docs/manual/basics/shape-mode-basics/) | [Track mode (basics)](/docs/manual/basics/track-mode-basics/) |
| Polygon | [Annotation with polygons](/docs/manual/advanced/annotation-with-polygons/) | [Track mode with polygons](/docs/manual/advanced/annotation-with-polygons/track-mode-with-polygons/) |
| Polyline | [Annotation with polylines](/docs/manual/advanced/annotation-with-polylines/) | |
| Points | [Points in shape mode](/docs/manual/advanced/annotation-with-points/points-in-shape-mode/) | [Liner interpolation with one point](/docs/manual/advanced/annotation-with-points/liner-interpolation-with-one-point/) |
| Cuboids | [Annotation with cuboids](/docs/manual/advanced/annotation-with-cuboids/) | [Editing the cuboid](/docs/manual/advanced/annotation-with-cuboids/editing-the-cuboid/) |
| Tag | [Annotation with tags](/docs/manual/advanced/annotation-with-tags/) | |

### Advanced

In CVAT there is the possibility of using automatic and semi-automatic annotation what gives
you the opportunity to speed up the execution of the annotation:

- [OpenCV tools](/docs/manual/advanced/opencv-tools/) - tools included in CVAT by default.
- [AI tools](/docs/manual/advanced/ai-tools/) - tools requiring installation.
- [Automatic annotation](/docs/manual/advanced/automatic-annotation/) - automatic annotation with using DL models.

## Export dataset

![](/images/image028.jpg)

1. To download the annotations, first you have to save all changes.
Click the `Save` button or press `Ctrl+S`to save annotations quickly.

1. After you saved the changes, click the `Menu` button.

1. Then click the `Export dataset` button.

1. Lastly choose a format of the dataset.
Exporting is available in formats from the [list of supported formats](/docs/manual/advanced/formats/).

To learn more, go to [export/import datasets](/docs/manual/advanced/export-import-datasets/) section.
5 changes: 0 additions & 5 deletions site/content/en/docs/getting_started/product_tour/_index.md

This file was deleted.

10 changes: 0 additions & 10 deletions site/content/en/docs/getting_started/product_tour/cvat-intro.md

This file was deleted.

Loading

0 comments on commit 2616210

Please sign in to comment.