-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added automatic annotation progress to the task view (#2148)
* Added automatic annotation progress to the task view * Updated changelog & version Co-authored-by: Nikita Manovich <nikita.manovich@intel.com>
- Loading branch information
Showing
5 changed files
with
106 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
cvat-ui/src/components/tasks-page/automatic-annotation-progress.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (C) 2020 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import React from 'react'; | ||
import { Row, Col } from 'antd/lib/grid'; | ||
import Text from 'antd/lib/typography/Text'; | ||
import Progress from 'antd/lib/progress'; | ||
import Tooltip from 'antd/lib/tooltip'; | ||
import Icon from 'antd/lib/icon'; | ||
import Modal from 'antd/lib/modal'; | ||
import { ActiveInference } from 'reducers/interfaces'; | ||
|
||
interface Props { | ||
activeInference: ActiveInference | null; | ||
cancelAutoAnnotation(): void; | ||
} | ||
|
||
export default function AutomaticAnnotationProgress(props: Props): JSX.Element | null { | ||
const { activeInference, cancelAutoAnnotation } = props; | ||
if (!activeInference) return null; | ||
|
||
return ( | ||
<> | ||
<Row> | ||
<Col> | ||
<Text strong>Automatic annotation</Text> | ||
</Col> | ||
</Row> | ||
<Row type='flex' justify='space-between'> | ||
<Col span={22}> | ||
<Progress | ||
percent={Math.floor(activeInference.progress)} | ||
strokeColor={{ | ||
from: '#108ee9', | ||
to: '#87d068', | ||
}} | ||
showInfo={false} | ||
strokeWidth={5} | ||
size='small' | ||
/> | ||
</Col> | ||
<Col span={1} className='close-auto-annotation-icon'> | ||
<Tooltip title='Cancel automatic annotation' mouseLeaveDelay={0}> | ||
<Icon | ||
type='close' | ||
onClick={() => { | ||
Modal.confirm({ | ||
title: 'You are going to cancel automatic annotation?', | ||
content: 'Reached progress will be lost. Continue?', | ||
okType: 'danger', | ||
onOk() { | ||
cancelAutoAnnotation(); | ||
}, | ||
}); | ||
}} | ||
/> | ||
</Tooltip> | ||
</Col> | ||
</Row> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters