-
Notifications
You must be signed in to change notification settings - Fork 378
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
Add data module for LEVIR-CD+ dataset #1707
Conversation
Error on cicd: After updating the image type to |
No tests should require internet access, you should use the fake data in |
We format the mask as |
Test fails with
which is why the plot test fails also |
Kornia augmentations require it to be |
You'll need to set |
Appears an empty image is passed in the test.. torchgeo/datasets/levircd.py:240: in plot
image1 = get_rgb(sample["image1"])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
img = tensor([[[0., 0., 0.]]])
def get_rgb(img: Tensor) -> "np.typing.NDArray[np.uint8]":
img = img.permute(1, 2, 0)
rgb_img = img.float().numpy()
per02 = np.percentile(rgb_img, 2)
per98 = np.percentile(rgb_img, 98)
> rgb_img = (np.clip((rgb_img - per02) / (per98 - per02), 0, 1) * 255).astype(
np.uint8
)
E RuntimeWarning: invalid value encountered in divide |
Could also create fake images with non-zero values, but dividing by epsilon is more robust. |
P.S. We actually need a ChangeDetectionTask for another project we're working on. If you have a working example, it would be good to open a PR and iterate on that. |
Re ChangeDetectionTask that's next on my list - wanted a couple of datasets to eval on first :-) |
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
The suggested change resulted in
|
Yep, looks like it doesn't work |
Can you upload a new example plot to the PR description so we can make sure it looks okay? |
Added cast back in and now get
|
Latest effort results in
|
Close #1706