Copilot/add weights and check overlays#35
Merged
Conversation
… refactoring - Upgrade curriculum to YOLOv11s-seg.pt with increased batch sizes (16-32), resolutions (up to 1024), and workers - Add validation step after each training stage with --overlay visualization - Implement parallel digitization using ThreadPoolExecutor - Fix mask alignment bug caused by tight_layout() shifting axes after mask generation - Fix CI PYTHONPATH override and smoke test paths - Create DigitizerModel wrapper to encapsulate inference logic - Add InterpretationProjection layer for embedding and style prediction - Refactor synth files into digitizer.synth module - Update test mocks for new DigitizerModel signature
- Add marker attribute to curve styles in curve_plotting.py - Add arrowstyle and label_pos to arrow annotations in annotations.py - Create _write_style_labels function in output.py to generate style_labels.json - Style labels map each curve/annotation to normalized style indices for training - Supports linestyle (4 classes), marker (4 classes), color (6 classes), arrowstyle (5 classes), and label position (x, y)
- Create InterpretationLoss class for combined style classification and regression losses - Add load_style_labels and style_labels_to_tensors utilities for training data preparation - Support for linestyle, marker, color, arrowstyle classification and linewidth, label_pos regression - Update layers __init__.py to export new components
- Add curriculum command to automate generate→train→fine-tune pipeline - Refactor training hyp scaffolding to strip architecture keys from YAML and inject hyperparams directly, preventing model re-initialization - Fix broken digitize tests: patch DigitizerModel instead of run_ai_segmentation, use truth CSV columns for mock data, enable overlay assertions
- progress.json tracks completed stages with weights and timestamps - --status shows human-readable progress report - --chain-info shows weight chain without running - --sync scans checkpoints and creates/updates progress.json - --resume now checks both progress.json AND actual checkpoint files - start.sh auto-syncs before training to pick up existing checkpoints - Clear logging shows input/output weights at each stage
- Replace hardcoded synthetic_plot_digitizer paths with _find_stage_weights() - _find_latest_run_dir() finds seg/seg2/seg3… and legacy synthetic_plot_digitizer dirs - Interrupted stages (checkpoint exists but progress.json not marked done) are re-run - Shorten training run name from synthetic_plot_digitizer to seg - --chain-info and --status now work with any run directory naming
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 26 changed files in this pull request and generated 8 comments.
Comments suppressed due to low confidence (1)
start.sh:42
- The subshell ends with
) || echo "Press [Enter] to continue..."butreadruns unconditionally afterwards. On success, the prompt is never printed yet the script still blocks waiting for input; on failure, the prompt prints but the subshell has already exited. Consider printing the prompt unconditionally (or conditionally) and only callingreadwhen intended.
echo ""
echo "Training complete. Best model: runs/stage4/train/seg*/weights/best.pt"
echo "MLflow UI: mlflow ui --backend-store-uri file:${OUTPUT}/mlruns"
) || echo "Press [Enter] to continue..."
read
Comment on lines
+38
to
+40
| echo "Training complete. Best model: runs/stage4/train/seg*/weights/best.pt" | ||
| echo "MLflow UI: mlflow ui --backend-store-uri file:${OUTPUT}/mlruns" | ||
| ) || echo "Press [Enter] to continue..." |
Comment on lines
+105
to
+110
| if workers is not None: | ||
| _torch.set_num_threads(workers) | ||
| try: | ||
| _torch.set_num_interop_threads(workers) | ||
| except RuntimeError: | ||
| LOGGER.debug( | ||
| "Unable to set torch inter-op thread count to %s; continuing with existing setting.", | ||
| workers, | ||
| ) | ||
| pass |
Comment on lines
+137
to
+145
| # MLflow: log weights and register model | ||
| if mlflow_run_id and mlflow_stage_name: | ||
| _log_to_mlflow(mlflow_run_id, train_kwargs["project"], mlflow_stage_name, weights) | ||
|
|
||
| return training_plan | ||
|
|
||
|
|
||
| def _log_to_mlflow(run_id: str, project_dir: str, stage_name: str, input_weights: str) -> None: | ||
| """Log training artifacts to MLflow and register the model.""" |
…compat flags, unused import, debug log, dead param Agent-Logs-Url: https://github.com/14NGiestas/plot-digitizer/sessions/93076b94-d19e-4264-bfc9-a55ac4c70dab Co-authored-by: 14NGiestas <14851487+14NGiestas@users.noreply.github.com>
Contributor
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/14NGiestas/plot-digitizer/sessions/05fa4244-4c07-4237-a951-86213d3a8678 Co-authored-by: 14NGiestas <14851487+14NGiestas@users.noreply.github.com>
Agent-Logs-Url: https://github.com/14NGiestas/plot-digitizer/sessions/0a9b0076-adea-4b87-ae72-1e35f66240cf Co-authored-by: 14NGiestas <14851487+14NGiestas@users.noreply.github.com>
Agent-Logs-Url: https://github.com/14NGiestas/plot-digitizer/sessions/32cea40c-bbca-4733-be89-20f500c55a5b Co-authored-by: 14NGiestas <14851487+14NGiestas@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 29 changed files in this pull request and generated 7 comments.
Comments suppressed due to low confidence (1)
src/digitizer/synth/output.py:265
_write_style_labelsreads curve styles fromdesc.get("style", {}), butcurve_descriptorsstorecolor/linestyle/markerat the top level (not nested under astylekey). As a result, exported curve style labels will always fall back to defaults instead of reflecting the generated styles.
Comment on lines
67
to
81
| @@ -34,17 +76,14 @@ def run_training( | |||
| "task": "segment", | |||
| "amp": amp, | |||
| } | |||
| hyp_path = hyp_yaml.resolve() if hyp_yaml is not None else None | |||
| if hyp_path is not None: | |||
| if not hyp_path.exists(): | |||
| raise FileNotFoundError(f"Hyperparameter config not found: {hyp_path}") | |||
| training_plan["cfg"] = str(hyp_path) | |||
| if workers is not None: | |||
Agent-Logs-Url: https://github.com/14NGiestas/plot-digitizer/sessions/0cd84bfb-56b2-46f4-920c-0914cd35282e Co-authored-by: 14NGiestas <14851487+14NGiestas@users.noreply.github.com>
Agent-Logs-Url: https://github.com/14NGiestas/plot-digitizer/sessions/0cd84bfb-56b2-46f4-920c-0914cd35282e Co-authored-by: 14NGiestas <14851487+14NGiestas@users.noreply.github.com>
Agent-Logs-Url: https://github.com/14NGiestas/plot-digitizer/sessions/1bca86f1-c931-47f1-bda6-3e1a1ff56fe0 Co-authored-by: 14NGiestas <14851487+14NGiestas@users.noreply.github.com>
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.
No description provided.