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

IOG serverless function + some fixes #2578

Merged
merged 33 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
40275cf
Initial version of Inside Outside Guidance serverless function
Oct 12, 2020
f8bfb5f
Fix function.yaml for IOG
Oct 12, 2020
5e8ccd9
Add "processorMountMode: volume" to restart containers after reboot (…
Oct 13, 2020
5e4c8e0
Fix crash in IOG serverless function (it doesn't work right now as well)
Oct 13, 2020
3cbd3c0
Fix for points translation from crop to image.
Oct 13, 2020
afc7eef
Add crop_box parameter to IOG function
Oct 22, 2020
f538f30
Merge remote-tracking branch 'origin/develop' into nm/serverlss_tutorial
Oct 22, 2020
d23e76b
Update nuclio dashboard till 1.5.1 version
Oct 22, 2020
119d30f
Support neg_points in interactors
Oct 23, 2020
208528d
Add dummy serverless function for optimization
Oct 23, 2020
3f647d0
Remove dummy serverless function and update the list of available ser…
Oct 23, 2020
8f7a055
Improved deployment process of serverless functions
Oct 24, 2020
1b14f38
Improve installation.md for serverless functions.
Oct 24, 2020
ec08d4a
Minor changes in doc for serverless
Oct 24, 2020
bbd5dbc
Merge remote-tracking branch 'origin/develop' into nm/serverlss_tutorial
Oct 24, 2020
b8951c6
Merge remote-tracking branch 'origin/develop' into nm/serverlss_tutorial
Nov 10, 2020
d3b1df3
Merge remote-tracking branch 'origin/develop' into nm/serverlss_tutorial
Dec 15, 2020
b7b4d79
Revert the tutorial.
Dec 15, 2020
303eea5
Merge remote-tracking branch 'origin/develop' into nm/serverless_iog
Feb 3, 2021
5b33aca
Merged develop
Feb 5, 2021
9f25e8b
Merge branch 'nm/serverless_iog' of github.com:openvinotoolkit/cvat i…
Feb 9, 2021
63eb39d
Fix codacy issues
Feb 9, 2021
2defc22
Update CHANGELOG, use NUCLIO_DASHBOARD_DEFAULT_FUNCTION_MOUNT_MODE as
Feb 9, 2021
d64c0ef
Removed volume mode from functions (it is handled by
Feb 9, 2021
16fefe7
Disable warning from markdown linter about max line length for a table.
Feb 9, 2021
97e2984
Revert wrong changes
Feb 9, 2021
cd58eb2
Merge remote-tracking branch 'origin/develop' into nm/serverless_iog
Feb 9, 2021
7f7d6f9
Reverted changes in requirements for cvat (numpy).
Feb 9, 2021
049c643
Dashboard env variable doesn't work by a reason. Added back mountMode
Feb 10, 2021
34177f3
Fix IOG function with conda environment
Feb 10, 2021
ece913b
Fix tensorflow matterport/mask_rcnn
Feb 10, 2021
b65c03d
Merge remote-tracking branch 'origin/develop' into nm/serverless_iog
Feb 10, 2021
e76be34
Bump version of cvat-ui.
Feb 10, 2021
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
17 changes: 10 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@
"request": "launch",
"stopOnEntry": false,
"justMyCode": false,
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/manage.py",
"env": {
"CVAT_SERVERLESS": "1",
},
"args": [
"runserver",
"--noreload",
Expand Down Expand Up @@ -73,7 +76,7 @@
"request": "launch",
"stopOnEntry": false,
"justMyCode": false,
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/manage.py",
"args": [
"rqworker",
Expand All @@ -92,7 +95,7 @@
"request": "launch",
"stopOnEntry": false,
"justMyCode": false,
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/manage.py",
"args": [
"rqscheduler",
Expand All @@ -108,7 +111,7 @@
"request": "launch",
"justMyCode": false,
"stopOnEntry": false,
"pythonPath":"${command:python.interpreterPath}",
"python":"${command:python.interpreterPath}",
"program": "${workspaceRoot}/manage.py",
"args": [
"rqworker",
Expand All @@ -127,7 +130,7 @@
"request": "launch",
"justMyCode": false,
"stopOnEntry": false,
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/manage.py",
"args": [
"update_git_states"
Expand All @@ -143,7 +146,7 @@
"request": "launch",
"justMyCode": false,
"stopOnEntry": false,
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/manage.py",
"args": [
"migrate"
Expand All @@ -159,7 +162,7 @@
"request": "launch",
"justMyCode": false,
"stopOnEntry": false,
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/manage.py",
"args": [
"test",
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- CVAT-3D: Load all frames corresponding to the job instance
(<https://github.com/openvinotoolkit/cvat/pull/2645>)
- Intelligent scissors with OpenCV javascript (<https://github.com/openvinotoolkit/cvat/pull/2689>)
- [Inside Outside Guidence](https://github.com/shiyinzhang/Inside-Outside-Guidance) serverless
function for interative segmentation

### Changed

- Updated HTTPS install README section (cleanup and described more robust deploy)
- Logstash is improved for using with configurable elasticsearch outputs (<https://github.com/openvinotoolkit/cvat/pull/2531>)
- Bumped nuclio version to 1.5.16
- All methods for interative segmentation accept negative points as well

### Deprecated

Expand Down
37 changes: 24 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,26 @@ For more information about supported formats look at the
| [ImageNet](http://www.image-net.org) | X | X |
| [CamVid](http://mi.eng.cam.ac.uk/research/projects/VideoRec/CamVid/) | X | X |

## Deep learning models for automatic labeling
## Deep learning serverless functions for automatic labeling

<!--lint disable maximum-line-length-->

| Name | Type | Framework | CPU | GPU |
| ------------------------------------------------------------------------------------------------------- | ---------- | ---------- | --- | --- |
| [Deep Extreme Cut](/serverless/openvino/dextr/nuclio) | interactor | OpenVINO | X |
| [Deep Extreme Cut](/serverless/openvino/dextr/nuclio) | interactor | OpenVINO | X | |
| [Faster RCNN](/serverless/openvino/omz/public/faster_rcnn_inception_v2_coco/nuclio) | detector | OpenVINO | X | |
| [Mask RCNN](/serverless/openvino/omz/public/mask_rcnn_inception_resnet_v2_atrous_coco/nuclio) | detector | OpenVINO | X | |
| [YOLO v3](/serverless/openvino/omz/public/yolo-v3-tf/nuclio) | detector | OpenVINO | X | |
| [Object reidentification](/serverless/openvino/omz/intel/person-reidentification-retail-300/nuclio) | reid | OpenVINO | X | |
| [Semantic segmentation for ADAS](/serverless/openvino/omz/intel/semantic-segmentation-adas-0001/nuclio) | detector | OpenVINO | X | |
| [Text detection v4](/serverless/openvino/omz/intel/text-detection-0004/nuclio) | detector | OpenVINO | X | |
| [SiamMask](/serverless/pytorch/foolwood/siammask/nuclio) | tracker | PyTorch | X | |
| [f-BRS](/serverless/pytorch/saic-vul/fbrs/nuclio) | interactor | PyTorch | X | |
| [Inside-Outside Guidance](/serverless/pytorch/shiyinzhang/iog/nuclio) | interactor | PyTorch | X | |
| [Faster RCNN](/serverless/tensorflow/faster_rcnn_inception_v2_coco/nuclio) | detector | TensorFlow | X | X |
| [Mask RCNN](/serverless/openvino/omz/public/mask_rcnn_inception_resnet_v2_atrous_coco/nuclio) | detector | OpenVINO | X |
| [YOLO v3](/serverless/openvino/omz/public/yolo-v3-tf/nuclio) | detector | OpenVINO | X |
| [Text detection v4](/serverless/openvino/omz/intel/text-detection-0004/nuclio) | detector | OpenVINO | X |
| [Semantic segmentation for ADAS](/serverless/openvino/omz/intel/semantic-segmentation-adas-0001/nuclio) | detector | OpenVINO | X |
| [Mask RCNN](/serverless/tensorflow/matterport/mask_rcnn/nuclio) | detector | TensorFlow | X |
| [Object reidentification](/serverless/openvino/omz/intel/person-reidentification-retail-300/nuclio) | reid | OpenVINO | X |
| [Mask RCNN](/serverless/tensorflow/matterport/mask_rcnn/nuclio) | detector | TensorFlow | X | |

<!--lint enable maximum-line-length-->

## Online demo: [cvat.org](https://cvat.org)

Expand All @@ -93,11 +101,12 @@ Limitations:

## REST API

Automatically generated Swagger documentation for Django REST API is
available on `<cvat_origin>/api/swagger`
(default: `localhost:8080/api/swagger`).
Automatically generated Swagger documentation for Django REST API is available
on `<cvat_origin>/api/swagger`(default: `localhost:8080/api/swagger`).

Swagger documentation is visiable on allowed hostes, Update environement variable in docker-compose.yml file with cvat hosted machine IP or domain name. Example - `ALLOWED_HOSTS: 'localhost, 127.0.0.1'`)
Swagger documentation is visiable on allowed hostes, Update environement
variable in docker-compose.yml file with cvat hosted machine IP or domain
name. Example - `ALLOWED_HOSTS: 'localhost, 127.0.0.1'`.

## LICENSE

Expand Down Expand Up @@ -129,4 +138,6 @@ Other ways to ask questions and get our support:

## Projects using CVAT

- [Onepanel](https://github.com/onepanelio/core) - Onepanel is an open source vision AI platform that fully integrates CVAT with scalable data processing and parallelized training pipelines.
- [Onepanel](https://github.com/onepanelio/core) - Onepanel is an open source
vision AI platform that fully integrates CVAT with scalable data processing
and parallelized training pipelines.
3 changes: 2 additions & 1 deletion components/serverless/docker-compose.serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.3'
services:
serverless:
container_name: nuclio
image: quay.io/nuclio/dashboard:1.5.8-amd64
image: quay.io/nuclio/dashboard:1.5.16-amd64
restart: always
networks:
default:
Expand All @@ -16,6 +16,7 @@ services:
https_proxy:
no_proxy: 172.28.0.1,${no_proxy}
NUCLIO_CHECK_FUNCTION_CONTAINERS_HEALTHINESS: 'true'
NUCLIO_DASHBOARD_DEFAULT_FUNCTION_MOUNT_MODE: 'volume'
ports:
- '8070:8070'

Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/server-proxy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2020 Intel Corporation
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/session.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2020 Intel Corporation
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down
6 changes: 4 additions & 2 deletions cvat-data/src/js/unzip_imgs.worker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -7,7 +7,9 @@ const JSZip = require('jszip');
onmessage = (e) => {
const zip = new JSZip();
if (e.data) {
const { start, end, block, dimension, dimension2D } = e.data;
const {
start, end, block, dimension, dimension2D,
} = e.data;

zip.loadAsync(block).then((_zip) => {
let index = start;
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.14.1",
"version": "1.14.2",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
5 changes: 1 addition & 4 deletions cvat-ui/src/actions/annotation-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1362,10 +1362,7 @@ export function pasteShapeAsync(): ThunkAction {
};
}

export function interactWithCanvas(
activeInteractor: Model | OpenCVTool,
activeLabelID: number,
): AnyAction {
export function interactWithCanvas(activeInteractor: Model | OpenCVTool, activeLabelID: number): AnyAction {
return {
type: AnnotationActionTypes.INTERACT_WITH_CANVAS,
payload: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class OpenCVControlComponent extends React.PureComponent<Props & DispatchToProps
const {
shapesUpdated, isDone, threshold, shapes,
} = (e as CustomEvent).detail;
const pressedPoints = convertShapesForInteractor(shapes).flat();
const pressedPoints = convertShapesForInteractor(shapes, 0).flat();
this.interactionIsDone = isDone;

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
try {
result = await core.lambda.call(jobInstance.task, interactor, {
frame,
points: convertShapesForInteractor((e as CustomEvent).detail.shapes),
pos_points: convertShapesForInteractor((e as CustomEvent).detail.shapes, 0),
neg_points: convertShapesForInteractor((e as CustomEvent).detail.shapes, 2),
});

if (this.interactionIsAborted) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down
16 changes: 8 additions & 8 deletions cvat-ui/src/components/labels-editor/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ function validateParsedAttribute(attr: Attribute): void {

if (!['number', 'undefined'].includes(typeof attr.id)) {
throw new Error(
`Attribute: "${attr.name}". ` + `Type of attribute id must be a number or undefined. Got value ${attr.id}`,
`Attribute: "${attr.name}". Type of attribute id must be a number or undefined. Got value ${attr.id}`,
);
}

if (!['checkbox', 'number', 'text', 'radio', 'select'].includes((attr.input_type || '').toLowerCase())) {
throw new Error(`Attribute: "${attr.name}". ` + `Unknown input type: ${attr.input_type}`);
throw new Error(`Attribute: "${attr.name}". Unknown input type: ${attr.input_type}`);
}

if (typeof attr.mutable !== 'boolean') {
throw new Error(
`Attribute: "${attr.name}". ` + `Mutable flag must be a boolean value. Got value ${attr.mutable}`,
`Attribute: "${attr.name}". Mutable flag must be a boolean value. Got value ${attr.mutable}`,
);
}

if (!Array.isArray(attr.values)) {
throw new Error(
`Attribute: "${attr.name}". ` + `Attribute values must be an array. Got type ${typeof attr.values}`,
`Attribute: "${attr.name}". Attribute values must be an array. Got type ${typeof attr.values}`,
);
}

Expand All @@ -52,7 +52,7 @@ function validateParsedAttribute(attr: Attribute): void {

for (const value of attr.values) {
if (typeof value !== 'string') {
throw new Error(`Attribute: "${attr.name}". ` + `Each value must be a string. Got value ${value}`);
throw new Error(`Attribute: "${attr.name}". Each value must be a string. Got value ${value}`);
}
}
}
Expand All @@ -64,12 +64,12 @@ export function validateParsedLabel(label: Label): void {

if (!['number', 'undefined'].includes(typeof label.id)) {
throw new Error(
`Label "${label.name}". ` + `Type of label id must be only a number or undefined. Got value ${label.id}`,
`Label "${label.name}". Type of label id must be only a number or undefined. Got value ${label.id}`,
);
}

if (typeof label.color !== 'string') {
throw new Error(`Label "${label.name}". ` + `Label color must be a string. Got ${typeof label.color}`);
throw new Error(`Label "${label.name}". Label color must be a string. Got ${typeof label.color}`);
}

if (!label.color.match(/^#[0-9a-fA-F]{6}$|^$/)) {
Expand All @@ -80,7 +80,7 @@ export function validateParsedLabel(label: Label): void {
}

if (!Array.isArray(label.attributes)) {
throw new Error(`Label "${label.name}". ` + `attributes must be an array. Got type ${typeof label.attributes}`);
throw new Error(`Label "${label.name}". Attributes must be an array. Got type ${typeof label.attributes}`);
}

for (const attr of label.attributes) {
Expand Down
4 changes: 3 additions & 1 deletion cvat-ui/src/containers/actions-menu/actions-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import ActionsMenuComponent, { Actions } from 'components/actions-menu/actions-m
import { CombinedState } from 'reducers/interfaces';

import { modelsActions } from 'actions/models-actions';
import { dumpAnnotationsAsync, loadAnnotationsAsync, exportDatasetAsync, deleteTaskAsync } from 'actions/tasks-actions';
import {
dumpAnnotationsAsync, loadAnnotationsAsync, exportDatasetAsync, deleteTaskAsync,
} from 'actions/tasks-actions';
// eslint-disable-next-line import/no-extraneous-dependencies
import { MenuInfo } from 'rc-menu/lib/interface';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down
18 changes: 9 additions & 9 deletions cvat-ui/src/cvat-canvas-wrapper.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 All @@ -12,20 +12,20 @@ import {
InteractionResult as _InteractionResult,
} from 'cvat-canvas/src/typescript/canvas';

export function convertShapesForInteractor(shapes: InteractionResult[]): number[][] {
export function convertShapesForInteractor(shapes: InteractionResult[], button: number): number[][] {
const reducer = (acc: number[][], _: number, index: number, array: number[]): number[][] => {
if (!(index % 2)) { // 0, 2, 4
acc.push([
array[index],
array[index + 1],
]);
if (!(index % 2)) {
// 0, 2, 4
acc.push([array[index], array[index + 1]]);
}
return acc;
};

return shapes.filter((shape: InteractionResult): boolean => shape.shapeType === 'points' && shape.button === 0)
return shapes
.filter((shape: InteractionResult): boolean => shape.shapeType === 'points' && shape.button === button)
.map((shape: InteractionResult): number[] => shape.points)
.flat().reduce(reducer, []);
.flat()
.reduce(reducer, []);
}

export type InteractionData = _InteractionData;
Expand Down
5 changes: 3 additions & 2 deletions cvat-ui/src/reducers/annotation-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,9 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
},
canvas: {
...state.canvas,
activeControl: activeInteractor
.type.startsWith('opencv') ? ActiveControl.OPENCV_TOOLS : ActiveControl.AI_TOOLS,
activeControl: activeInteractor.type.startsWith('opencv') ?
ActiveControl.OPENCV_TOOLS :
ActiveControl.AI_TOOLS,
},
};
}
Expand Down
3 changes: 2 additions & 1 deletion cvat/apps/documentation/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ Please see the [Docker documentation](https://docs.docker.com/network/proxy/) fo

```bash
# Build and run containers with Analytics component support:
docker-compose -f docker-compose.yml -f components/analytics/docker-compose.analytics.yml up -d --build
docker-compose -f docker-compose.yml \
-f components/analytics/docker-compose.analytics.yml up -d --build
```

### Semi-automatic and automatic annotation
Expand Down
Loading