Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanovic authored Jun 5, 2020
2 parents ef38a71 + 306e91c commit 5970402
Show file tree
Hide file tree
Showing 88 changed files with 797 additions and 397 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Throttling policy for unauthenticated users (<https://github.com/opencv/cvat/pull/1531>)
- Added default label color table for mask export (https://github.com/opencv/cvat/pull/1549)
- Added environment variables for Redis and Postgres hosts for Kubernetes deployment support (<https://github.com/opencv/cvat/pull/1641>)
- Added visual identification for unavailable formats (https://github.com/opencv/cvat/pull/1567)

### Changed
- Removed information about e-mail from the basic user information (<https://github.com/opencv/cvat/pull/1627>)
Expand All @@ -20,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-

### Fixed
-
- Fixed interpreter crash when trying to import `tensorflow` with no AVX instructions available (https://github.com/opencv/cvat/pull/1567)

### Security
-
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-core",
"version": "2.0.1",
"version": "2.1.1",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js",
"scripts": {
Expand Down
22 changes: 22 additions & 0 deletions cvat-core/src/annotation-formats.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
name: initialData.name,
format: initialData.ext,
version: initialData.version,
enabled: initialData.enabled,
};

Object.defineProperties(this, {
Expand Down Expand Up @@ -48,6 +49,16 @@
*/
get: () => data.version,
},
enabled: {
/**
* @name enabled
* @type {string}
* @memberof module:API.cvat.classes.Loader
* @readonly
* @instance
*/
get: () => data.enabled,
},
});
}
}
Expand All @@ -63,6 +74,7 @@
name: initialData.name,
format: initialData.ext,
version: initialData.version,
enabled: initialData.enabled,
};

Object.defineProperties(this, {
Expand Down Expand Up @@ -96,6 +108,16 @@
*/
get: () => data.version,
},
enabled: {
/**
* @name enabled
* @type {string}
* @memberof module:API.cvat.classes.Loader
* @readonly
* @instance
*/
get: () => data.enabled,
},
});
}
}
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.2.0",
"version": "1.2.1",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions cvat-ui/src/assets/reset-perspective.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions cvat-ui/src/components/actions-menu/actions-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ interface Props {
taskMode: string;
bugTracker: string;

loaders: string[];
dumpers: string[];
loaders: any[];
dumpers: any[];
loadActivity: string | null;
dumpActivities: string[] | null;
exportActivities: string[] | null;
Expand Down
18 changes: 11 additions & 7 deletions cvat-ui/src/components/actions-menu/dump-submenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function isDefaultFormat(dumperName: string, taskMode: string): boolean {
interface Props {
taskMode: string;
menuKey: string;
dumpers: string[];
dumpers: any[];
dumpActivities: string[] | null;
}

Expand All @@ -30,17 +30,21 @@ export default function DumpSubmenu(props: Props): JSX.Element {
return (
<Menu.SubMenu key={menuKey} title='Dump annotations'>
{
dumpers.map((dumper: string): JSX.Element => {
const pending = (dumpActivities || []).includes(dumper);
const isDefault = isDefaultFormat(dumper, taskMode);
dumpers
.sort((a: any, b: any) => a.name.localeCompare(b.name))
.map((dumper: any): JSX.Element =>
{
const pending = (dumpActivities || []).includes(dumper.name);
const disabled = !dumper.enabled || pending;
const isDefault = isDefaultFormat(dumper.name, taskMode);
return (
<Menu.Item
key={dumper}
disabled={pending}
key={dumper.name}
disabled={disabled}
className='cvat-menu-dump-submenu-item'
>
<Icon type='download' />
<Text strong={isDefault}>{dumper}</Text>
<Text strong={isDefault} disabled={disabled}>{dumper.name}</Text>
{pending && <Icon style={{ marginLeft: 10 }} type='loading' />}
</Menu.Item>
);
Expand Down
16 changes: 10 additions & 6 deletions cvat-ui/src/components/actions-menu/export-submenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Text from 'antd/lib/typography/Text';

interface Props {
menuKey: string;
exporters: string[];
exporters: any[];
exportActivities: string[] | null;
}

Expand All @@ -23,16 +23,20 @@ export default function ExportSubmenu(props: Props): JSX.Element {
return (
<Menu.SubMenu key={menuKey} title='Export as a dataset'>
{
exporters.map((exporter: string): JSX.Element => {
const pending = (exportActivities || []).includes(exporter);
exporters
.sort((a: any, b: any) => a.name.localeCompare(b.name))
.map((exporter: any): JSX.Element =>
{
const pending = (exportActivities || []).includes(exporter.name);
const disabled = !exporter.enabled || pending;
return (
<Menu.Item
key={exporter}
disabled={pending}
key={exporter.name}
disabled={disabled}
className='cvat-menu-export-submenu-item'
>
<Icon type='export' />
<Text>{exporter}</Text>
<Text disabled={disabled}>{exporter.name}</Text>
{pending && <Icon style={{ marginLeft: 10 }} type='loading' />}
</Menu.Item>
);
Expand Down
23 changes: 15 additions & 8 deletions cvat-ui/src/components/actions-menu/load-submenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Text from 'antd/lib/typography/Text';

interface Props {
menuKey: string;
loaders: string[];
loaders: any[];
loadActivity: string | null;
onFileUpload(file: File): void;
}
Expand All @@ -27,13 +27,20 @@ export default function LoadSubmenu(props: Props): JSX.Element {
return (
<Menu.SubMenu key={menuKey} title='Upload annotations'>
{
loaders.map((_loader: string): JSX.Element => {
const [loader, accept] = _loader.split('::');
const pending = loadActivity === loader;
loaders
.sort((a: any, b: any) => a.name.localeCompare(b.name))
.map((loader: any): JSX.Element =>
{
const accept = loader.format
.split(',')
.map((x: string) => '.' + x.trimStart())
.join(', '); // add '.' to each extension in a list
const pending = loadActivity === loader.name;
const disabled = !loader.enabled || !!loadActivity;
return (
<Menu.Item
key={loader}
disabled={!!loadActivity}
key={loader.name}
disabled={disabled}
className='cvat-menu-load-submenu-item'
>
<Upload
Expand All @@ -45,9 +52,9 @@ export default function LoadSubmenu(props: Props): JSX.Element {
return false;
}}
>
<Button block type='link' disabled={!!loadActivity}>
<Button block type='link' disabled={disabled}>
<Icon type='upload' />
<Text>{loader}</Text>
<Text>{loader.name}</Text>
{pending && <Icon style={{ marginLeft: 10 }} type='loading' />}
</Button>
</Upload>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
NextIcon,
BackgroundIcon,
ForegroundIcon,
ResetPerspectiveIcon,
} from 'icons';
import { ObjectType, ShapeType } from 'reducers/interfaces';
import { clamp } from 'utils/math';
Expand All @@ -38,6 +39,7 @@ function ItemMenu(
serverID: number | undefined,
locked: boolean,
objectType: ObjectType,
shapeType: ShapeType,
copyShortcut: string,
pasteShortcut: string,
propagateShortcut: string,
Expand All @@ -50,6 +52,8 @@ function ItemMenu(
createURL: (() => void),
toBackground: (() => void),
toForeground: (() => void),
switchCuboidOrientation: (() => void),
resetCuboidPerspective: (() => void),
): JSX.Element {
return (
<Menu className='cvat-object-item-menu'>
Expand All @@ -72,7 +76,22 @@ function ItemMenu(
</Button>
</Tooltip>
</Menu.Item>
{ objectType !== ObjectType.TAG && (
{shapeType === ShapeType.CUBOID && (
<Menu.Item>
<Button type='link' icon='retweet' onClick={switchCuboidOrientation}>
Switch orientation
</Button>
</Menu.Item>
)}
{shapeType === ShapeType.CUBOID && (
<Menu.Item>
<Button type='link' onClick={resetCuboidPerspective}>
<Icon component={ResetPerspectiveIcon}/>
Reset perspective
</Button>
</Menu.Item>
)}
{objectType !== ObjectType.TAG && (
<Menu.Item>
<Tooltip title={`${toBackgroundShortcut}`}>
<Button type='link' onClick={toBackground}>
Expand All @@ -82,7 +101,7 @@ function ItemMenu(
</Tooltip>
</Menu.Item>
)}
{ objectType !== ObjectType.TAG && (
{objectType !== ObjectType.TAG && (
<Menu.Item>
<Tooltip title={`${toForegroundShortcut}`}>
<Button type='link' onClick={toForeground}>
Expand Down Expand Up @@ -125,6 +144,7 @@ interface ItemTopComponentProps {
labelID: number;
labels: any[];
objectType: ObjectType;
shapeType: ShapeType;
type: string;
locked: boolean;
copyShortcut: string;
Expand All @@ -140,6 +160,8 @@ interface ItemTopComponentProps {
createURL(): void;
toBackground(): void;
toForeground(): void;
switchCuboidOrientation(): void;
resetCuboidPerspective(): void;
}

function ItemTopComponent(props: ItemTopComponentProps): JSX.Element {
Expand All @@ -149,6 +171,7 @@ function ItemTopComponent(props: ItemTopComponentProps): JSX.Element {
labelID,
labels,
objectType,
shapeType,
type,
locked,
copyShortcut,
Expand All @@ -164,6 +187,8 @@ function ItemTopComponent(props: ItemTopComponentProps): JSX.Element {
createURL,
toBackground,
toForeground,
switchCuboidOrientation,
resetCuboidPerspective,
} = props;

return (
Expand Down Expand Up @@ -191,6 +216,7 @@ function ItemTopComponent(props: ItemTopComponentProps): JSX.Element {
serverID,
locked,
objectType,
shapeType,
copyShortcut,
pasteShortcut,
propagateShortcut,
Expand All @@ -203,6 +229,8 @@ function ItemTopComponent(props: ItemTopComponentProps): JSX.Element {
createURL,
toBackground,
toForeground,
switchCuboidOrientation,
resetCuboidPerspective,
)}
>
<Icon type='more' />
Expand Down Expand Up @@ -727,6 +755,8 @@ interface Props {
changeAttribute(attrID: number, value: string): void;
changeColor(color: string): void;
collapse(): void;
switchCuboidOrientation(): void;
resetCuboidPerspective(): void;
}

function objectItemsAreEqual(prevProps: Props, nextProps: Props): boolean {
Expand Down Expand Up @@ -804,6 +834,8 @@ function ObjectItemComponent(props: Props): JSX.Element {
changeAttribute,
changeColor,
collapse,
switchCuboidOrientation,
resetCuboidPerspective,
} = props;

const type = objectType === ObjectType.TAG ? ObjectType.TAG.toUpperCase()
Expand Down Expand Up @@ -842,6 +874,7 @@ function ObjectItemComponent(props: Props): JSX.Element {
labels={labels}
objectType={objectType}
type={type}
shapeType={shapeType}
locked={locked}
copyShortcut={normalizedKeyMap.COPY_SHAPE}
pasteShortcut={normalizedKeyMap.PASTE_SHAPE}
Expand All @@ -856,6 +889,8 @@ function ObjectItemComponent(props: Props): JSX.Element {
createURL={createURL}
toBackground={toBackground}
toForeground={toForeground}
switchCuboidOrientation={switchCuboidOrientation}
resetCuboidPerspective={resetCuboidPerspective}
/>
<ItemButtons
shapeType={shapeType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import ReIDPlugin from './reid-plugin';

interface Props {
taskMode: string;
loaders: string[];
dumpers: string[];
loaders: any[];
dumpers: any[];
loadActivity: string | null;
dumpActivities: string[] | null;
exportActivities: string[] | null;
Expand Down
Loading

0 comments on commit 5970402

Please sign in to comment.