diff --git a/backend/training.go b/backend/training.go index d02681f..fe0c0cc 100644 --- a/backend/training.go +++ b/backend/training.go @@ -536,7 +536,7 @@ func trainingRunJob(root string, count int) { detectorScript, "--root", root, "--base", "yolo11n.pt", - "--epochs", "80", + "--epochs", "20", "--imgsz", "640", ) diff --git a/frontend/src/components/ui/TrainingTab.tsx b/frontend/src/components/ui/TrainingTab.tsx index dce45bf..b938820 100644 --- a/frontend/src/components/ui/TrainingTab.tsx +++ b/frontend/src/components/ui/TrainingTab.tsx @@ -213,6 +213,37 @@ function sortTrainingLabels(input: Partial | null | undefined): } } +function TrainingOverlay(props: { step: string; progress: number }) { + return ( +
+ + +
+ Training läuft… +
+ +
+ {props.step || 'Bitte warten. Die Oberfläche ist währenddessen gesperrt.'} +
+ +
+
+
+ +
+ {Math.round(props.progress)}% +
+
+ ) +} + export default function TrainingTab() { const [labels, setLabels] = useState(emptyLabels) const [sample, setSample] = useState(null) @@ -353,12 +384,9 @@ export default function TrainingTab() { if (cancelled) return - const res = await fetch('/api/training/status', { cache: 'no-store' }) - const data = await res.json().catch(() => null) - - if (!cancelled && !data?.training?.running) { - await loadNext() - } + // Wichtig: Auch während laufendem Training wieder das aktuelle offene Sample laden, + // damit nicht "Kein Frame geladen" angezeigt wird. + await loadNext() } void init() @@ -819,22 +847,6 @@ export default function TrainingTab() { {trainingRunning ? 'Training läuft…' : 'Training starten'} - {trainingRunning ? ( -
-
- {shownTrainingStep || 'Training läuft…'} - {Math.round(shownTrainingProgress)}% -
- -
-
-
-
- ) : null} -
{canStartTraining ? ( <> @@ -865,14 +877,7 @@ export default function TrainingTab() { {/* Mitte */}
- {loading ? ( - - ) : imageSrc ? ( + {imageSrc ? (
{ e.preventDefault() @@ -935,7 +940,7 @@ export default function TrainingTab() { onClick={(e) => { e.preventDefault() e.stopPropagation() - if (!isDraft) removeBox(index) + if (!isDraft && !uiLocked) removeBox(index) }} > {box.label} @@ -951,35 +956,26 @@ export default function TrainingTab() { })}
+ {trainingRunning ? ( -
- - -
- Training läuft… -
- -
- {shownTrainingStep || 'Bitte warten. Die Oberfläche ist währenddessen gesperrt.'} -
- -
-
-
- -
- {Math.round(shownTrainingProgress)}% -
-
+ ) : null}
+ ) : trainingRunning ? ( + + ) : loading ? ( + ) : (
Kein Frame geladen
)}