Don't require state classification models to select all classes

This commit is contained in:
Nicolas Mowen 2025-12-03 11:13:27 -07:00
parent e473117705
commit f2ce5572bd
2 changed files with 2 additions and 28 deletions

View File

@ -177,7 +177,7 @@
"generateSuccess": "Successfully generated sample images", "generateSuccess": "Successfully generated sample images",
"missingStatesWarning": { "missingStatesWarning": {
"title": "Missing State Examples", "title": "Missing State Examples",
"description": "You haven't selected examples for all states. The model will not be trained until all states have images. After continuing, use the Recent Classifications view to classify images for the missing states, then train the model." "description": "It's recommended to select examples for all states for best results. You can continue without selecting all states, but the model will not be trained until all states have images. After continuing, use the Recent Classifications view to classify images for the missing states, then train the model."
} }
} }
} }

View File

@ -407,30 +407,6 @@ export default function Step3ChooseExamples({
return allClasses.every((className) => statesWithExamples.has(className)); return allClasses.every((className) => statesWithExamples.has(className));
}, [step1Data.modelType, allClasses, statesWithExamples]); }, [step1Data.modelType, allClasses, statesWithExamples]);
// For state models on the last class, require all images to be classified
// But allow proceeding even if not all states have examples (with warning)
const canProceed = useMemo(() => {
if (step1Data.modelType === "state" && isLastClass) {
// Check if all 24 images will be classified after current selections are applied
const totalImages = unknownImages.slice(0, 24).length;
// Count images that will be classified (either already classified or currently selected)
const allImages = unknownImages.slice(0, 24);
const willBeClassified = allImages.filter((img) => {
return imageClassifications[img] || selectedImages.has(img);
}).length;
return willBeClassified >= totalImages;
}
return true;
}, [
step1Data.modelType,
isLastClass,
unknownImages,
imageClassifications,
selectedImages,
]);
const hasUnclassifiedImages = useMemo(() => { const hasUnclassifiedImages = useMemo(() => {
if (!unknownImages) return false; if (!unknownImages) return false;
const allImages = unknownImages.slice(0, 24); const allImages = unknownImages.slice(0, 24);
@ -594,9 +570,7 @@ export default function Step3ChooseExamples({
} }
variant="select" variant="select"
className="flex items-center justify-center gap-2 sm:flex-1" className="flex items-center justify-center gap-2 sm:flex-1"
disabled={ disabled={!hasGenerated || isGenerating || isProcessing}
!hasGenerated || isGenerating || isProcessing || !canProceed
}
> >
{isProcessing && <ActivityIndicator className="size-4" />} {isProcessing && <ActivityIndicator className="size-4" />}
{t("button.continue", { ns: "common" })} {t("button.continue", { ns: "common" })}