Skip to content

Commit

Permalink
Merge branch 'develop' into kl/improve-single-shape-save
Browse files Browse the repository at this point in the history
  • Loading branch information
klakhov authored Dec 11, 2024
2 parents 3f38703 + 11ea2ee commit 2b79eb3
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 16 deletions.
4 changes: 4 additions & 0 deletions changelog.d/20241209_110126_sekachev.bs_support_boolean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Added

- Support for boolean parameters in annotations actions
(<https://github.com/cvat-ai/cvat/pull/8798>)
1 change: 1 addition & 0 deletions cvat-core/src/annotations-actions/base-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Job, Task } from '../session';
export enum ActionParameterType {
SELECT = 'select',
NUMBER = 'number',
CHECKBOX = 'checkbox',
}

// For SELECT values should be a list of possible options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ import { getCVATStore } from 'cvat-store';
import {
BaseCollectionAction, BaseAction, Job, getCore,
ObjectState,
ActionParameterType,
} from 'cvat-core-wrapper';
import { Canvas } from 'cvat-canvas-wrapper';
import { fetchAnnotationsAsync } from 'actions/annotation-actions';
import { clamp } from 'utils/math';
import { Switch } from 'antd/lib';

const core = getCore();

Expand Down Expand Up @@ -248,7 +250,7 @@ function ActionParameterComponent(props: ActionParameterProps & { onChange: (val

const computedValues = typeof values === 'function' ? values({ instance: job }) : values;

if (type === 'select') {
if (type === ActionParameterType.SELECT) {
return (
<Select value={value} onChange={setValue}>
{computedValues.map((_value: string) => (
Expand All @@ -258,8 +260,18 @@ function ActionParameterComponent(props: ActionParameterProps & { onChange: (val
);
}

const [min, max, step] = computedValues.map((val) => +val);
if (type === ActionParameterType.CHECKBOX) {
return (
<Switch
checked={value.toLowerCase() === 'true'}
onChange={(val: boolean) => {
setValue(String(val));
}}
/>
);
}

const [min, max, step] = computedValues.map((val) => +val);
return (
<InputNumber
value={+value}
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: MIT

name: cvat

x-backend-env: &backend-env
CVAT_POSTGRES_HOST: cvat_db
CVAT_REDIS_INMEM_HOST: cvat_redis_inmem
Expand Down
6 changes: 3 additions & 3 deletions serverless/deploy_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ do
echo "Deploying $func_rel_path function..."
nuctl deploy --project-name cvat --path "$func_root" \
--file "$func_config" --platform local \
--env CVAT_REDIS_HOST=$(echo ${CVAT_REDIS_INMEM_HOST:-cvat_redis_ondisk}) \
--env CVAT_REDIS_PORT=$(echo ${CVAT_REDIS_INMEM_PORT:-6666}) \
--env CVAT_REDIS_PASSWORD=$(echo ${CVAT_REDIS_INMEM_PASSWORD})
--env CVAT_FUNCTIONS_REDIS_HOST=cvat_redis_ondisk \
--env CVAT_FUNCTIONS_REDIS_PORT=6666 \
--platform-config '{"attributes": {"network": "cvat_cvat"}}'
done

nuctl get function --platform local
6 changes: 3 additions & 3 deletions serverless/deploy_gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ do
echo "Deploying $func_rel_path function..."
nuctl deploy --project-name cvat --path "$func_root" \
--file "$func_config" --platform local \
--env CVAT_REDIS_HOST=$(echo ${CVAT_REDIS_INMEM_HOST:-cvat_redis_ondisk}) \
--env CVAT_REDIS_PORT=$(echo ${CVAT_REDIS_INMEM_PORT:-6666}) \
--env CVAT_REDIS_PASSWORD=$(echo ${CVAT_REDIS_INMEM_PASSWORD})
--env CVAT_FUNCTIONS_REDIS_HOST=cvat_redis_ondisk \
--env CVAT_FUNCTIONS_REDIS_PORT=6666 \
--platform-config '{"attributes": {"network": "cvat_cvat"}}'
done

nuctl get function --platform local
5 changes: 4 additions & 1 deletion site/content/en/docs/administration/basics/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export CVAT_HOST=<YOUR_DOMAIN>
### Share path

You can use shared storage for uploading data when you create a task.
To do that, you must mount the shared storage to the CVAT docker container. Example of
To do that, you need to mount the shared storage to the CVAT docker container. Example of
docker-compose.override.yml for this purpose:

```yml
Expand All @@ -477,6 +477,9 @@ services:
cvat_worker_annotation:
volumes:
- cvat_share:/home/django/share:ro
cvat_worker_chunks:
volumes:
- cvat_share:/home/django/share:ro

volumes:
cvat_share:
Expand Down
8 changes: 4 additions & 4 deletions site/content/en/docs/api_sdk/sdk/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ the repository. To get the full package, one need to generate missing package fi
1. Install the packages:

```bash
pip install cvat-sdk/
pip install cvat-cli/
pip install ./cvat-sdk
pip install ./cvat-cli
```

If you want to edit package files, install them with `-e`:

```bash
pip install -e cvat-sdk/
pip install -e cvat-cli/
pip install -e ./cvat-sdk
pip install -e ./cvat-cli
```

## How to edit templates
Expand Down
3 changes: 3 additions & 0 deletions site/content/en/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ services:
cvat_worker_annotation:
volumes:
- cvat_share:/home/django/share:ro
cvat_worker_chunks:
volumes:
- cvat_share:/home/django/share:ro

volumes:
cvat_share:
Expand Down
8 changes: 5 additions & 3 deletions tests/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ the server calling REST API directly (as it done by users).
## How to run?
**Initial steps**

1. On Debian/Ubuntu, make sure that your `$USER` is in `docker` group:
```shell
sudo usermod -aG docker $USER
```
1. Follow [this guide](../../site/content/en/docs/api_sdk/sdk/developer-guide.md) to prepare
`cvat-sdk` and `cvat-cli` source code
1. Install all necessary requirements before running REST API tests:
```
```shell
pip install -r ./tests/python/requirements.txt
pip install -e ./cvat-sdk
pip install -e ./cvat-cli
```
1. Stop any other CVAT containers which you run previously. They keep ports
which are used by containers for the testing system.
Expand Down

0 comments on commit 2b79eb3

Please sign in to comment.