Skip to content

Copilot/add weights and check overlays#35

Merged
14NGiestas merged 15 commits into
mainfrom
copilot/add-weights-and-check-overlays
May 23, 2026
Merged

Copilot/add weights and check overlays#35
14NGiestas merged 15 commits into
mainfrom
copilot/add-weights-and-check-overlays

Conversation

@14NGiestas

Copy link
Copy Markdown
Owner

No description provided.

… 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

- 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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..." but read runs 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 calling read when 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 thread src/digitizer/digitize_workflow.py Outdated
Comment thread start.sh
Comment thread start.sh Outdated
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 thread src/digitizer/parser.py
Comment thread src/digitizer/__init__.py Outdated
Comment thread tests/test_digitizer.py
Comment thread src/digitizer/training.py Outdated
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 thread src/digitizer/training.py
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>

Copilot AI commented May 23, 2026

Copy link
Copy Markdown
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:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh pr view --json number,title,body ogs --allowed-origins &#39;localhost;localhost:*;127.0.0.1;127.0.0.1:*&#39; (http block)
    • Triggering command: /usr/bin/gh gh pr list --state open (http block)

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/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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_labels reads curve styles from desc.get("style", {}), but curve_descriptors store color/linestyle/marker at the top level (not nested under a style key). As a result, exported curve style labels will always fall back to defaults instead of reflecting the generated styles.

Comment thread src/digitizer/__init__.py
Comment thread src/digitizer/digitize_workflow.py
Comment thread tests/test_digitizer.py Outdated
Comment thread start.sh Outdated
Comment thread src/digitizer/training.py Outdated
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:
Comment thread hyps/custom_yolo11s-seg-interpret.yaml Outdated
Comment thread start.sh Outdated
Copilot AI and others added 2 commits May 23, 2026 16:54
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>
@14NGiestas 14NGiestas merged commit 119bfb7 into main May 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants