Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ChesapeakeCVPR to use NLCD colormap #1690

Merged
merged 10 commits into from
Jan 20, 2024

Conversation

alhridoy
Copy link
Contributor

@alhridoy alhridoy commented Oct 22, 2023

Fixes #1264

This PR updates the ChesapeakeCVPR class in torchgeo/datasets/chesapeake.py to use the colormap from the NLCD dataset.

Changes include:

  • Set self.cmap to NLCD.cmap in the __init__ method of the ChesapeakeCVPR class.
  • Defined a property _nlcd_cmap that returns self.cmap.

@github-actions github-actions bot added the datasets Geospatial or benchmark datasets label Oct 22, 2023
@alhridoy
Copy link
Contributor Author

@microsoft-github-policy-service agree

@microsoft-github-policy-service agree

@adamjstewart adamjstewart added this to the 0.5.1 milestone Oct 22, 2023
@adamjstewart adamjstewart modified the milestones: 0.5.1, 0.6.0 Nov 6, 2023
@calebrob6
Copy link
Member

I like this change @alhridoy, thanks for the contribution! Let me know if you want help with the linters / mypy / etc.

@alhridoy
Copy link
Contributor Author

Hi @adamjstewart @calebrob6 I've made the changes as per your suggestions. I've removed the _nlcd_cmap property and replaced all its references with self.cmap. I've also set self.cmap to NLCD.cmap in the __init__ method and removed the block of code that was creating nlcd_colors and _nlcd_cmap. Would you check and give me feedbacks.

torchgeo/datasets/chesapeake.py Show resolved Hide resolved
torchgeo/datasets/chesapeake.py Outdated Show resolved Hide resolved
torchgeo/datasets/chesapeake.py Outdated Show resolved Hide resolved
torchgeo/datasets/chesapeake.py Outdated Show resolved Hide resolved
@adamjstewart
Copy link
Collaborator

Ping @alhridoy

@adamjstewart
Copy link
Collaborator

There are now no changes lol.

@alhridoy
Copy link
Contributor Author

There are now no changes lol.

Hi @adamjstewart,

I've made the changes as per your suggestions and committed them. Could you please check and confirm if everything is in order now? Thanks for your guidance and patience.

@adamjstewart
Copy link
Collaborator

Still need to do this:

You can now delete nlcd_cmap at the top of this class, it's no longer used.

@alhridoy
Copy link
Contributor Author

Still need to do this:

You can now delete nlcd_cmap at the top of this class, it's no longer used.

Regarding your suggestion to remove the nlcd_cmap attribute from the Chesapeake class, I noticed that it's being used in the ChesapeakeCVPR class for creating a colormap for the "nlcd" layer. Could you please confirm if the removal is intended for the ChesapeakeCVPR class instead? Thanks for your guidance.

You can now delete nlcd_cmap at the top of this class, it's no longer used.

@adamjstewart
Copy link
Collaborator

Yes, for ChesapeakeCVPR. The Chesapeake class doesn't include NLCD data.

@alhridoy
Copy link
Contributor Author

Some checks were not successful

11 successful, 8 cancelled, and 2 failing checks

After removing the nlcd_cmap I've noticed that some of the checks are failing for my recent commit, specifically the pytest checks. I've looked into the details but I'm having trouble understanding why these tests are failing. Could you please help me understand what might be causing these failures, and how I can fix them?

@adamjstewart
Copy link
Collaborator

Seems like an intermittent issue, restarting the test solved it.

@adamjstewart adamjstewart merged commit b20ee4f into microsoft:main Jan 20, 2024
21 checks passed
@alhridoy
Copy link
Contributor Author

Seems like an intermittent issue, restarting the test solved it.

Thank you for your patient and guidance throughout the PR. I am happy to contribute.

@adamjstewart
Copy link
Collaborator

Thanks for contributing! Hopefully the first of many 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasets Geospatial or benchmark datasets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ChesapeakeCVPR: use NLCD mapping/cmap
3 participants