Skip to content

Commit

Permalink
Run ReID from UI (#1949)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Jul 28, 2020
1 parent 1973a07 commit d32201e
Show file tree
Hide file tree
Showing 13 changed files with 119 additions and 411 deletions.
13 changes: 3 additions & 10 deletions cvat-ui/src/actions/models-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ export function getModelsAsync(): ThunkAction {

try {
const models = (await core.lambda.list())
.filter((model: Model) => model.type === 'detector');
.filter((model: Model) => ['detector', 'reid'].includes(model.type));
dispatch(modelsActions.getModelsSuccess(models));
} catch (error) {
dispatch(modelsActions.getModelsFailed(error));
return;
}
};
}
Expand Down Expand Up @@ -158,17 +157,11 @@ export function getInferenceStatusAsync(): ThunkAction {
export function startInferenceAsync(
taskInstance: any,
model: Model,
mapping: {
[index: string]: string;
},
cleanup: boolean,
body: object,
): ThunkAction {
return async (dispatch): Promise<void> => {
try {
const requestID: string = await core.lambda.run(taskInstance, model, {
mapping,
cleanup,
});
const requestID: string = await core.lambda.run(taskInstance, model, body);

const dispatchCallback = (action: ModelsActions): void => {
dispatch(action);
Expand Down
4 changes: 1 addition & 3 deletions cvat-ui/src/actions/plugins-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@ export function checkPluginsAsync(): ThunkAction {
const plugins: PluginObjects = {
ANALYTICS: false,
GIT_INTEGRATION: false,
REID: false,
DEXTR_SEGMENTATION: false,
};

const promises: Promise<boolean>[] = [
PluginChecker.check(SupportedPlugins.ANALYTICS),
PluginChecker.check(SupportedPlugins.GIT_INTEGRATION),
PluginChecker.check(SupportedPlugins.DEXTR_SEGMENTATION),
PluginChecker.check(SupportedPlugins.REID),
];

const values = await Promise.all(promises);
[plugins.ANALYTICS, plugins.GIT_INTEGRATION,
plugins.DEXTR_SEGMENTATION, plugins.REID] = values;
plugins.DEXTR_SEGMENTATION] = values;
dispatch(pluginActions.checkedAllPlugins(plugins));
};
}
8 changes: 1 addition & 7 deletions cvat-ui/src/actions/tasks-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,7 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
const promises = array
.map((task): string => (task as any).frames.preview());

dispatch(
getInferenceStatusAsync(
array.map(
(task: any): number => task.id,
),
),
);
dispatch(getInferenceStatusAsync());

for (const promise of promises) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Modal from 'antd/lib/modal';
import DumpSubmenu from 'components/actions-menu/dump-submenu';
import LoadSubmenu from 'components/actions-menu/load-submenu';
import ExportSubmenu from 'components/actions-menu/export-submenu';
import ReIDPlugin from './reid-plugin';

interface Props {
taskMode: string;
Expand All @@ -18,7 +17,6 @@ interface Props {
loadActivity: string | null;
dumpActivities: string[] | null;
exportActivities: string[] | null;
installedReID: boolean;
taskID: number;
onClickMenu(params: ClickParam, file?: File): void;
}
Expand All @@ -40,7 +38,6 @@ export default function AnnotationMenuComponent(props: Props): JSX.Element {
loadActivity,
dumpActivities,
exportActivities,
installedReID,
taskID,
} = props;

Expand Down Expand Up @@ -125,7 +122,6 @@ export default function AnnotationMenuComponent(props: Props): JSX.Element {
Open the task
</a>
</Menu.Item>
{ installedReID && <ReIDPlugin /> }
</Menu>
);
}
227 changes: 0 additions & 227 deletions cvat-ui/src/components/annotation-page/top-bar/reid-plugin.tsx

This file was deleted.

Loading

0 comments on commit d32201e

Please sign in to comment.