Repository navigation
Labelling page: train the learned check from the labels - #63
Merged
Merged
Conversation
Labels are given on the Labelling Frames page (#60), but the check was trained from the command line only. - The page gains Train this check: cameras (each with an optional crop), state columns and a folder name. It trains on the labels of every loaded dataset, shows its progress, and then the held-out report, false passes first, per held-out episode. - The job runs the same command the README gives, in its own process (one at a time): GET/POST /checks/train, POST /checks/train/stop. GET /checks lists the trained checks with their reports. - The label view also gives each dataset's cameras and state columns.
- A new job could start while the last was stopping, and the old job's thread then took over the new one (marked it failed, left its process untracked). Starting is refused while a job runs or stops, and a process's threads only touch their own job. - A stop that raced the end reported "stopped" for a check that had been saved: an exit with the result is done; a check saved before a stop is kept and said so; a check folder left half-written (stopped or failed mid-save) is removed, so it no longer blocks its name. Stop does not signal a process that has already ended. - The page's Stop button was rebuilt every second and could lose a click; only the progress line changes now. A job found running on opening the page now locks the form at once. - Crops keep every digit on the way to the command; names must match whole (a trailing newline was accepted); GET /checks reads the folder training writes to; the server stops a training when it stops; the child speaks UTF-8 on Windows; only video cameras and listed state names are offered; escapeHtml escapes quotes (the same fix as #62).
# Conflicts: # src/flexivtrainer/web/index.html # tests/test_api_app.py # tests/test_gripper_ui_contract.py # tests/test_rollout_evaluation_ui_contract.py
# Conflicts: # src/flexivtrainer/web/index.html # tests/test_api_app.py # tests/test_gripper_ui_contract.py # tests/test_rollout_evaluation_ui_contract.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Labels are given on the Labelling Frames page (#60), but the learned check could only be trained from the command line. This adds Train this check to the same page, so step 6 of Stage 1 (label, then train the "latched" check) needs no terminal.
What changes
x0,y0,x1,y1), state columns, and the folder to save to (default: the label's name).epoch 12/30: loss …), with Stop.checks/<name>). A failure shows the command's ownerror:line.python -m flexivtrainer.evaluation.learned_check train …) in its own process: one at a time, so the server stays responsive and the GPU memory is freed when it ends.POST /checks/trainstarts it. Datasets are held to the storage root (403/404). A bad request gets 400, and so does a name already taken. One already running gets 409.GET /checks/traingives its state, log tail and result.POST /checks/train/stopstops it.GET /checkslists the trained checks under<storage>/checks/with what they look at and their held-out reports./datasets/check-labelsalso returns each dataset's cameras (depth maps left out) and state columns, for the form.Tests
Backend:
tests/test_check_training.pycovers:GET /checkslisting it;error:line;Panel logic:
tests/label_frames_ui.test.cjsgains 3 tests:Each of 5 mutations is caught.
By hand: headless Firefox against a test server on a scratch copy of a recorded dataset (4 episodes labelled through the API). I chose wrist_1 with a crop and Fz, then pressed Train. It trained ResNet-18 on the CPU in its own process, then showed the held-out report and saved
checks/seated_ui. The report itself means nothing, as the labels were arbitrary. No page errors.Note for merging
This PR and #61/#62 each bump the static asset version (
?v=) inindex.htmland three tests. Whichever merges second has that one conflict; I'll resolve it.Review fixes (second commit)
An independent review reproduced two real races in the job. Both are fixed and tested.
saved);GET /checksreads the folder training writes to;escapeHtmlescapes quotes. This is the same change as Chains: judge each run, and count clean runs in a row #62, in identical text, so the two merge cleanly.