Skip to content

Commit d8d5e2f

Browse files
authored
ITEP-71002 - Show notification based on inference mode (#573)
1 parent 657d4ef commit d8d5e2f

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

web_ui/src/pages/project-details/components/project-tests/quick-inference/live-prediction-notification.component.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,28 @@ import { Close, Info } from '@geti/ui/icons';
77
import { TUTORIAL_CARD_KEYS } from '../../../../../core/user-settings/dtos/user-settings.interface';
88
import { UserGlobalSettings, UseSettings } from '../../../../../core/user-settings/services/user-settings.interface';
99
import { dismissTutorial } from '../../../../../shared/components/tutorials/utils';
10+
import { LiveInferenceMode } from './quick-inference-interfaces';
1011

1112
import classes from './quick-inference.module.scss';
1213

1314
interface LivePredictionNotificationProps {
1415
settings: UseSettings<UserGlobalSettings>;
16+
inferenceMode: LiveInferenceMode;
1517
}
1618

17-
export const LivePredictionNotification = ({ settings }: LivePredictionNotificationProps): JSX.Element => {
19+
export const LivePredictionNotification = ({
20+
settings,
21+
inferenceMode,
22+
}: LivePredictionNotificationProps): JSX.Element => {
1823
const handleDismissTutorial = async () => {
1924
await dismissTutorial(TUTORIAL_CARD_KEYS.LIVE_PREDICTION_NOTIFICATION, settings);
2025
};
2126

27+
const description =
28+
inferenceMode === 'Use file'
29+
? 'Upload an image to test with your active model right away.'
30+
: 'Use your camera to test your active model right away.';
31+
2232
return (
2333
<Flex
2434
maxWidth={'57rem'}
@@ -34,9 +44,7 @@ export const LivePredictionNotification = ({ settings }: LivePredictionNotificat
3444
style={{ marginRight: 'var(--spectrum-global-dimension-size-100)' }}
3545
/>
3646
</div>
37-
<Flex wrap={'wrap'}>
38-
Upload an image that you would like to test with your active model right away.
39-
</Flex>
47+
<Flex wrap={'wrap'}>{description}</Flex>
4048
</Flex>
4149
<ActionButton isQuiet onPress={handleDismissTutorial} isDisabled={settings.isSavingConfig}>
4250
<Close />
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Copyright (C) 2022-2025 Intel Corporation
2+
// LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE
3+
4+
export type LiveInferenceMode = 'Use file' | 'Use camera';

web_ui/src/pages/project-details/components/project-tests/quick-inference/quick-inference.component.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { Contents } from './contents.component';
2020
import { HeaderOptions } from './header-options.component';
2121
import { LiveCameraInference } from './live-camera-inference/live-camera-inference.component';
2222
import { LivePredictionNotification } from './live-prediction-notification.component';
23+
import { LiveInferenceMode } from './quick-inference-interfaces';
2324
import { QuickInferenceProvider, useQuickInference } from './quick-inference-provider.component';
2425
import { SecondaryToolbar } from './secondary-toolbar.component';
2526
import { useIsExplanationEnabled } from './use-is-explanation-enabled.hook';
@@ -74,8 +75,6 @@ const LiveFileInference = ({ imageWasUploaded }: { imageWasUploaded: boolean })
7475
);
7576
};
7677

77-
type LiveInferenceMode = 'Use file' | 'Use camera';
78-
7978
const QuickInferencePage = (): JSX.Element => {
8079
const { image, annotations, imageWasUploaded, isDisabled, onResetImage } = useQuickInference();
8180
const settings = useUserGlobalSettings();
@@ -101,7 +100,7 @@ const QuickInferencePage = (): JSX.Element => {
101100
animate={'visible'}
102101
exit={'hidden'}
103102
>
104-
<LivePredictionNotification settings={settings} />
103+
<LivePredictionNotification settings={settings} inferenceMode={liveInferenceMode} />
105104
</motion.div>
106105
)}
107106
</AnimatePresence>

0 commit comments

Comments
 (0)