WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@maxxgx
Copy link
Contributor

@maxxgx maxxgx commented Dec 8, 2025

📝 Description

  • added max_epochs to job payload
  • added option to turn anomaly map overlay on/off via PATCH pipeline
Screen.Recording.2025-12-08.at.16.40.37.mov

Overlay ON/OFF

Screen.Recording.2025-12-09.at.13.21.56.mov

✨ Changes

Select what type of change your PR is:

  • 🚀 New feature (non-breaking change which adds functionality)
  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🔄 Refactor (non-breaking change which refactors the code base)
  • ⚡ Performance improvements
  • 🎨 Style changes (code style/formatting)
  • 🧪 Tests (adding/modifying tests)
  • 📚 Documentation update
  • 📦 Build system changes
  • 🚧 CI/CD configuration
  • 🔧 Chore (general maintenance)
  • 🔒 Security update
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).
  • 🏷️ My PR title follows conventional commit format.

For more information about code review checklists, see the Code Review Checklist.

Signed-off-by: Max Xiang <[email protected]>
Copilot AI review requested due to automatic review settings December 8, 2025 16:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the pipeline visualization system and adds configurable training epochs. The changes improve the anomaly detection visualization by simplifying the heatmap overlay logic and making the prediction labels more readable with better styling. Additionally, it introduces a max_epochs parameter to the training job payload, allowing users to configure the number of training epochs instead of using a hardcoded value.

Key Changes:

  • Added max_epochs parameter to training job payload with validation (minimum 1, default 200)
  • Refactored visualization overlay methods for cleaner code and improved visual styling
  • Added is_bgr flag to prediction pipeline to properly handle color space conversions

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
application/backend/src/pydantic_models/job.py Added max_epochs field to TrainJobPayload with default value and validation
application/backend/src/services/training_service.py Integrated max_epochs from job payload into training pipeline
application/backend/src/services/model_service.py Added is_bgr parameter to handle color space conversion properly
application/backend/src/workers/inference.py Passed is_bgr=True flag to prediction method
application/backend/src/utils/visualization.py Refactored heatmap and label overlay methods with improved styling and cleaner logic
application/backend/tests/unit/services/test_training_service.py Updated tests to pass max_epochs parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 9, 2025 09:08
Copy link
Contributor

Copilot AI left a comment

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 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@ashwinvaidya17 ashwinvaidya17 left a comment

Choose a reason for hiding this comment

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

Looks good. Had a quick look at it so these are my initial comments.

model_name: str
device: str | None = Field(default=None)
dataset_snapshot_id: str | None = Field(default=None) # used because UUID is not JSON serializable
max_epochs: int | None = Field(default=None, ge=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

How are we planning on dealing with rest of the configurable parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't for the time being. We're likely going to remove this once we have a proper design for configurable parameters.

return original_image

@staticmethod
def overlay_anomaly_heatmap(
Copy link
Contributor

Choose a reason for hiding this comment

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

Something for the future but maybe we should consolidate the visualization methods here and the ones in anomalib. This way we won't have to maintain two separate visualizers

Signed-off-by: Max Xiang <[email protected]>
Copilot AI review requested due to automatic review settings December 9, 2025 13:05
@maxxgx maxxgx requested a review from MarkRedeman as a code owner December 9, 2025 13:05
Copy link
Contributor

Copilot AI left a comment

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 12 out of 12 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Max Xiang <[email protected]>
model=model,
device=device,
synchronization_parameters=synchronization_parameters,
max_epochs=max_epochs,

Choose a reason for hiding this comment

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

Should we add this to the model training dialog? cc @ashwinvaidya17, @MarkRedeman

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if we can already expose this (perhaps next to the picker of the training device from the new designs)

However there are some edge cases we would need to deal with. Some models will overwrite the max epochs to be 1 since they only need to do a single pass.
We could hardcode the UI to not show the input for those models, but that might get messy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's expose this and just have a note saying something like, "some models only extract features so max_epochs will be overridden for those models".

Signed-off-by: Colorado, Camilo <[email protected]>
Copilot AI review requested due to automatic review settings December 9, 2025 16:11
Copy link
Contributor

Copilot AI left a comment

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 18 out of 18 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Max Xiang <[email protected]>
Signed-off-by: Max Xiang <[email protected]>
Copilot AI review requested due to automatic review settings December 10, 2025 08:12
Copy link
Contributor

Copilot AI left a comment

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 18 out of 18 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@ashwinvaidya17 ashwinvaidya17 left a comment

Choose a reason for hiding this comment

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

Thanks for the efforts

@maxxgx maxxgx merged commit e42e288 into open-edge-platform:feature/geti-inspect Dec 10, 2025
21 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.

📋 [TASK] Geti Inspect: Add early stopping criteria to the training job

5 participants