mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-03 05:44:52 +03:00
Cleanup
This commit is contained in:
parent
7f093d81a9
commit
f3b1769dd8
@ -19,14 +19,12 @@ import { isDesktop } from "react-device-detect";
|
|||||||
const OBJECT_STEPS = [
|
const OBJECT_STEPS = [
|
||||||
"wizard.steps.nameAndDefine",
|
"wizard.steps.nameAndDefine",
|
||||||
"wizard.steps.chooseExamples",
|
"wizard.steps.chooseExamples",
|
||||||
"wizard.steps.train",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const STATE_STEPS = [
|
const STATE_STEPS = [
|
||||||
"wizard.steps.nameAndDefine",
|
"wizard.steps.nameAndDefine",
|
||||||
"wizard.steps.stateArea",
|
"wizard.steps.stateArea",
|
||||||
"wizard.steps.chooseExamples",
|
"wizard.steps.chooseExamples",
|
||||||
"wizard.steps.train",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
type ClassificationModelWizardDialogProps = {
|
type ClassificationModelWizardDialogProps = {
|
||||||
@ -116,10 +114,6 @@ export default function ClassificationModelWizardDialog({
|
|||||||
dispatch({ type: "SET_STEP_2", payload: data });
|
dispatch({ type: "SET_STEP_2", payload: data });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleStep3Next = (data: Step3FormData) => {
|
|
||||||
dispatch({ type: "SET_STEP_3", payload: data });
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleBack = () => {
|
const handleBack = () => {
|
||||||
dispatch({ type: "PREVIOUS_STEP" });
|
dispatch({ type: "PREVIOUS_STEP" });
|
||||||
};
|
};
|
||||||
@ -185,7 +179,7 @@ export default function ClassificationModelWizardDialog({
|
|||||||
step1Data={wizardState.step1Data}
|
step1Data={wizardState.step1Data}
|
||||||
step2Data={wizardState.step2Data}
|
step2Data={wizardState.step2Data}
|
||||||
initialData={wizardState.step3Data}
|
initialData={wizardState.step3Data}
|
||||||
onNext={handleStep3Next}
|
onClose={onClose}
|
||||||
onBack={handleBack}
|
onBack={handleBack}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ type Step3ChooseExamplesProps = {
|
|||||||
step1Data: Step1FormData;
|
step1Data: Step1FormData;
|
||||||
step2Data?: Step2FormData;
|
step2Data?: Step2FormData;
|
||||||
initialData?: Partial<Step3FormData>;
|
initialData?: Partial<Step3FormData>;
|
||||||
onNext: (data: Step3FormData) => void;
|
onClose: () => void;
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ export default function Step3ChooseExamples({
|
|||||||
step1Data,
|
step1Data,
|
||||||
step2Data,
|
step2Data,
|
||||||
initialData,
|
initialData,
|
||||||
onNext,
|
onClose,
|
||||||
onBack,
|
onBack,
|
||||||
}: Step3ChooseExamplesProps) {
|
}: Step3ChooseExamplesProps) {
|
||||||
const { t } = useTranslation(["views/classificationModel"]);
|
const { t } = useTranslation(["views/classificationModel"]);
|
||||||
@ -202,7 +202,7 @@ export default function Step3ChooseExamples({
|
|||||||
await axios.post(`/classification/${step1Data.modelName}/train`);
|
await axios.post(`/classification/${step1Data.modelName}/train`);
|
||||||
|
|
||||||
toast.success(t("wizard.step3.trainingStarted"));
|
toast.success(t("wizard.step3.trainingStarted"));
|
||||||
onNext({ examplesGenerated: true, imageClassifications });
|
onClose();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const axiosError = error as {
|
const axiosError = error as {
|
||||||
response?: { data?: { message?: string; detail?: string } };
|
response?: { data?: { message?: string; detail?: string } };
|
||||||
@ -218,7 +218,7 @@ export default function Step3ChooseExamples({
|
|||||||
t("wizard.step3.errors.classifyFailed", { error: errorMessage }),
|
t("wizard.step3.errors.classifyFailed", { error: errorMessage }),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [onNext, imageClassifications, step1Data, step2Data, t]);
|
}, [onClose, imageClassifications, step1Data, step2Data, t]);
|
||||||
|
|
||||||
const allImagesClassified = useMemo(() => {
|
const allImagesClassified = useMemo(() => {
|
||||||
if (!unknownImages || unknownImages.length === 0) return false;
|
if (!unknownImages || unknownImages.length === 0) return false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user