-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
CVAT-3D Milestone1 #2534
CVAT-3D Milestone1 #2534
Changes from 25 commits
a40d8dd
6bcac4a
db27800
7f89251
0fd3742
3be8ef9
6357751
6baeed3
d0c9b4f
13cd5ff
5be4b3d
9175c07
a9972e1
0877de4
da61f90
5e302c6
2fd3282
9432068
5675d7c
d14226a
733e4bb
fc5cf64
45d276f
6c0d765
86c7494
7c3017d
768a17e
6879381
f0217ca
2af7627
4b61eb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
format: initialData.ext, | ||
version: initialData.version, | ||
enabled: initialData.enabled, | ||
dimension: initialData.dimension | ||
}; | ||
|
||
Object.defineProperties(this, { | ||
|
@@ -58,6 +59,16 @@ | |
*/ | ||
get: () => data.enabled, | ||
}, | ||
dimension: { | ||
/** | ||
* @name dimension | ||
* @type {string} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made changes accordingly. |
||
* @memberof module:API.cvat.classes.Loader | ||
* @readonly | ||
* @instance | ||
*/ | ||
get: () => data.dimension, | ||
}, | ||
}); | ||
} | ||
} | ||
|
@@ -74,6 +85,7 @@ | |
format: initialData.ext, | ||
version: initialData.version, | ||
enabled: initialData.enabled, | ||
dimension: initialData.dimension | ||
}; | ||
|
||
Object.defineProperties(this, { | ||
|
@@ -117,6 +129,16 @@ | |
*/ | ||
get: () => data.enabled, | ||
}, | ||
dimension: { | ||
/** | ||
* @name dimension | ||
* @type {string} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made changes accordingly. |
||
* @memberof module:API.cvat.classes.Loader | ||
* @readonly | ||
* @instance | ||
*/ | ||
get: () => data.dimension, | ||
}, | ||
}); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -974,6 +974,7 @@ | |
use_zip_chunks: undefined, | ||
use_cache: undefined, | ||
copy_data: undefined, | ||
dimension: undefined | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed trailing comma There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made changes accordingly. |
||
}; | ||
|
||
let updatedFields = { | ||
|
@@ -1452,6 +1453,16 @@ | |
updatedFields = fields; | ||
}, | ||
}, | ||
dimension: { | ||
/** | ||
* @name enabled | ||
* @type {string} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably should be module:API.cvat.enums.TaskDimension There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made changes accordingly. |
||
* @memberof module:API.cvat.classes.Loader | ||
* @readonly | ||
* @instance | ||
*/ | ||
get: () => data.dimension, | ||
}, | ||
}), | ||
); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ import { MenuInfo } from 'rc-menu/lib/interface'; | |
import DumpSubmenu from './dump-submenu'; | ||
import LoadSubmenu from './load-submenu'; | ||
import ExportSubmenu from './export-submenu'; | ||
import {DimensionType} from "../../reducers/interfaces"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, use single quotes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed spaces in {} |
||
|
||
interface Props { | ||
taskID: number; | ||
|
@@ -22,7 +23,7 @@ interface Props { | |
dumpActivities: string[] | null; | ||
exportActivities: string[] | null; | ||
inferenceIsActive: boolean; | ||
|
||
taskDimension: DimensionType.DIM_3D | DimensionType.DIM_2D; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just |
||
onClickMenu: (params: MenuInfo, file?: File) => void; | ||
} | ||
|
||
|
@@ -47,6 +48,7 @@ export default function ActionsMenuComponent(props: Props): JSX.Element { | |
dumpActivities, | ||
exportActivities, | ||
loadActivity, | ||
taskDimension, | ||
} = props; | ||
|
||
let latestParams: MenuInfo | null = null; | ||
|
@@ -102,6 +104,7 @@ export default function ActionsMenuComponent(props: Props): JSX.Element { | |
dumpers, | ||
dumpActivities, | ||
menuKey: Actions.DUMP_TASK_ANNO, | ||
taskDimension, | ||
})} | ||
{LoadSubmenu({ | ||
loaders, | ||
|
@@ -110,11 +113,13 @@ export default function ActionsMenuComponent(props: Props): JSX.Element { | |
onClickMenuWrapper(null, file); | ||
}, | ||
menuKey: Actions.LOAD_TASK_ANNO, | ||
taskDimension, | ||
})} | ||
{ExportSubmenu({ | ||
exporters: dumpers, | ||
exportActivities, | ||
menuKey: Actions.EXPORT_TASK_DATASET, | ||
taskDimension, | ||
})} | ||
{!!bugTracker && <Menu.Item key={Actions.OPEN_BUG_TRACKER}>Open bug tracker</Menu.Item>} | ||
<Menu.Item disabled={inferenceIsActive} key={Actions.RUN_AUTO_ANNOTATION}> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import React from 'react'; | |
import Menu from 'antd/lib/menu'; | ||
import { DownloadOutlined, LoadingOutlined } from '@ant-design/icons'; | ||
import Text from 'antd/lib/typography/Text'; | ||
import {DimensionType} from '../../reducers/interfaces' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed spaces in {} |
||
|
||
function isDefaultFormat(dumperName: string, taskMode: string): boolean { | ||
return ( | ||
|
@@ -19,15 +20,17 @@ interface Props { | |
menuKey: string; | ||
dumpers: any[]; | ||
dumpActivities: string[] | null; | ||
taskDimension: DimensionType.DIM_3D | DimensionType.DIM_2D; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just |
||
} | ||
|
||
export default function DumpSubmenu(props: Props): JSX.Element { | ||
const { taskMode, menuKey, dumpers, dumpActivities } = props; | ||
const { taskMode, menuKey, dumpers, dumpActivities, taskDimension } = props; | ||
|
||
return ( | ||
<Menu.SubMenu key={menuKey} title='Dump annotations'> | ||
{dumpers | ||
.sort((a: any, b: any) => a.name.localeCompare(b.name)) | ||
.filter((dumper: any): boolean => dumper.dimension === taskDimension) | ||
.map( | ||
(dumper: any): JSX.Element => { | ||
const pending = (dumpActivities || []).includes(dumper.name); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,21 +5,24 @@ | |
import React from 'react'; | ||
import Menu from 'antd/lib/menu'; | ||
import Text from 'antd/lib/typography/Text'; | ||
import {DimensionType} from '../../reducers/interfaces' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed spaces in {} |
||
import { ExportOutlined, LoadingOutlined } from '@ant-design/icons'; | ||
|
||
interface Props { | ||
menuKey: string; | ||
exporters: any[]; | ||
exportActivities: string[] | null; | ||
taskDimension: DimensionType.DIM_3D | DimensionType.DIM_2D; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just |
||
} | ||
|
||
export default function ExportSubmenu(props: Props): JSX.Element { | ||
const { menuKey, exporters, exportActivities } = props; | ||
const { menuKey, exporters, exportActivities, taskDimension } = props; | ||
|
||
return ( | ||
<Menu.SubMenu key={menuKey} title='Export as a dataset'> | ||
{exporters | ||
.sort((a: any, b: any) => a.name.localeCompare(b.name)) | ||
.filter((exporter: any): boolean => exporter.dimension === taskDimension) | ||
.map( | ||
(exporter: any): JSX.Element => { | ||
const pending = (exportActivities || []).includes(exporter.name); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,24 +7,25 @@ import Menu from 'antd/lib/menu'; | |
import Upload from 'antd/lib/upload'; | ||
import Button from 'antd/lib/button'; | ||
import Text from 'antd/lib/typography/Text'; | ||
import {DimensionType} from "../../reducers/interfaces"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed spaces There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, use single quotes |
||
import { UploadOutlined, LoadingOutlined } from '@ant-design/icons'; | ||
|
||
interface Props { | ||
menuKey: string; | ||
loaders: any[]; | ||
loadActivity: string | null; | ||
onFileUpload(file: File): void; | ||
taskDimension: DimensionType.DIM_3D | DimensionType.DIM_2D; | ||
} | ||
|
||
export default function LoadSubmenu(props: Props): JSX.Element { | ||
const { | ||
menuKey, loaders, loadActivity, onFileUpload, | ||
} = props; | ||
const { menuKey, loaders, loadActivity, onFileUpload, taskDimension } = props; | ||
|
||
return ( | ||
<Menu.SubMenu key={menuKey} title='Upload annotations'> | ||
{loaders | ||
.sort((a: any, b: any) => a.name.localeCompare(b.name)) | ||
.filter((loader: any): boolean => loader.dimension === taskDimension) | ||
.map( | ||
(loader: any): JSX.Element => { | ||
const accept = loader.format | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,6 +161,7 @@ export default function AnnotationMenuComponent(props: Props): JSX.Element { | |
dumpers, | ||
dumpActivities, | ||
menuKey: Actions.DUMP_TASK_ANNO, | ||
taskDimension:jobInstance.task.dimension | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed space There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made changes accordingly. |
||
})} | ||
{LoadSubmenu({ | ||
loaders, | ||
|
@@ -169,11 +170,13 @@ export default function AnnotationMenuComponent(props: Props): JSX.Element { | |
onClickMenuWrapper(null, file); | ||
}, | ||
menuKey: Actions.LOAD_JOB_ANNO, | ||
taskDimension:jobInstance.task.dimension | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed space There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made changes accordingly. |
||
})} | ||
{ExportSubmenu({ | ||
exporters: dumpers, | ||
exportActivities, | ||
menuKey: Actions.EXPORT_TASK_DATASET, | ||
taskDimension:jobInstance.task.dimension | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed space There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made changes accordingly. |
||
})} | ||
|
||
<Menu.Item key={Actions.REMOVE_ANNO}>Remove annotations</Menu.Item> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import Text from 'antd/lib/typography/Text'; | |
import InputNumber from 'antd/lib/input-number'; | ||
import Button from 'antd/lib/button'; | ||
import notification from 'antd/lib/notification'; | ||
import {DimensionType} from '../../reducers/interfaces' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed space There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made changes accordingly. |
||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { OptionData, OptionGroupData } from 'rc-select/lib/interface'; | ||
|
||
|
@@ -127,7 +128,8 @@ function DetectorRunner(props: Props): JSX.Element { | |
<Col span={4}>Model:</Col> | ||
<Col span={20}> | ||
<Select | ||
placeholder='Select a model' | ||
placeholder={task.dimension === DimensionType.DIM_2D ? 'Select a model' : 'No models available'} | ||
disabled={task.dimension !== DimensionType.DIM_2D} | ||
style={{ width: '100%' }} | ||
onChange={(_modelID: string): void => { | ||
const newmodel = models.filter((_model): boolean => _model.id === _modelID)[0]; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,3 +569,8 @@ export interface CombinedState { | |
shortcuts: ShortcutsState; | ||
review: ReviewState; | ||
} | ||
|
||
export enum DimensionType { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @manasars , we have similar definition in cvat-core/src/enums.js. What is the reason for that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned in earlier review inputs, we have similar implementation of ReviewStatus in both the places, hence we implemented similarly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nmanovic Need to rewrite cvat-core in typescript to avoid this. |
||
DIM_3D = '3d', | ||
nmanovic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
DIM_2D = '2d', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed trailing comma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made changes accordingly.