Skip to content

Conversation

@donnadamus
Copy link

📝 Description

I was trying to just visualize image+heatmap, but the current code overrides the fields and if set to None, it would set it ["image", "gt_mask"], forcing the user to also save the original image

✨ Changes

Select what type of change your PR is:

  • 🚀 New feature (non-breaking change which adds functionality)
  • [x ] 🐞 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.

I was trying to just visualize image+heatmap, but the current code overrides the fields and if set to None, it would set it ["image", "gt_mask"], forcing the user to also save the original image

Signed-off-by: Marco Donnarumma <[email protected]>
Fix default fields initialization in visualizer
Copilot AI review requested due to automatic review settings October 17, 2025 12:28
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 fixes a bug where the fields parameter in the Visualizer class was being overridden with a default value ["image", "gt_mask"] when set to None, preventing users from visualizing only image+heatmap combinations without including the original image field.

Key changes:

  • Removed the default fallback value for the fields parameter when it is explicitly set to None

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

) -> None:
super().__init__()
self.fields = fields or ["image", "gt_mask"]
self.fields = fields
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

Setting self.fields = fields without a fallback allows None to be assigned directly. This could cause issues downstream if code expects self.fields to be a list. Consider checking whether fields being None is handled properly throughout the class, or document this behavior explicitly if None is a valid value for visualization logic.

Suggested change
self.fields = fields
self.fields = fields or ["image", "gt_mask"]

Copilot uses AI. Check for mistakes.
@donnadamus donnadamus changed the title Fix fields overiddes when set to None fix(visualization): Fix fields overiddes when set to None Oct 22, 2025
@donnadamus donnadamus changed the title fix(visualization): Fix fields overiddes when set to None fix(visualization): remove fields overiddes when set to None Oct 22, 2025
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.

1 participant