feat: Add NDWI visualization tool for label quality inspection#86
Open
AnvayKharb wants to merge 2 commits intofwitmer:masterfrom
Open
feat: Add NDWI visualization tool for label quality inspection#86AnvayKharb wants to merge 2 commits intofwitmer:masterfrom
AnvayKharb wants to merge 2 commits intofwitmer:masterfrom
Conversation
- Add visualize_ndwi.py: generates 4-panel NDWI label quality visualization (Original RGB | NDWI Heatmap | Binary Mask | Overlay) - Supports single image and batch directory processing via CLI - Implements simplified sliding-window Otsu thresholding for quick inspection - Band order matches existing codebase (Green=band2, NIR=last band) - Gaussian blur params match ndwi_labels.py defaults (kernel 9x9, sigma 6) - Majority threshold matches ndwi_labels.py (0.55) - Add 'ndwi' config block to config_template.json with window_size, blur_kernel, blur_sigma, and majority_threshold parameters - CLI args (--window_size, --blur_kernel, --blur_sigma) override config values - Graceful fallback when ndwi config block is absent - Band count validation prevents crashes on non-multispectral images - Filters out UDM files in directory mode - No modifications to existing pipeline scripts
- Raise std threshold from 1e-3 to 10 to reject single-class windows that caused Otsu to split land texture noise as water - Correct uint8 conversion to (ndwi * 127) + 128 matching ndwi_labels.py - Add global mean-threshold fallback for uncovered pixels, matching the concatenation logic in ndwi_labels.py (mean + 10 offset) - Result: clean solid land (black) and water (white) regions
Contributor
|
@AnvayKharb Looking forward to seeing more of your experiments and findings. |
Author
|
Thank you @Ritika-K7 I will continue experimenting with the dataset and pipeline and share my findings here. I have also sent an email regarding my GSoC proposal plan please do check it whenever you've time . |
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.
Adds
visualize_ndwi.pyto visually inspect NDWI label qualitybefore training.
What it does
Usage
python visualize_ndwi.py sample_data/PlanetLabs/
python visualize_ndwi.py sample_data/PlanetLabs/ --window_size 128
Notes