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