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

Strange edge effects with segmentation and super-resolution models #122

Open
Saareem opened this issue Nov 29, 2023 · 5 comments
Open

Strange edge effects with segmentation and super-resolution models #122

Saareem opened this issue Nov 29, 2023 · 5 comments

Comments

@Saareem
Copy link
Contributor

Saareem commented Nov 29, 2023

Super resolution, edge effects

Road segmentation, edge effects

As seen in the pictures above, the plugin produces weird edge artifacts on the top and right borders of the image. There is most likely one pixel missing from the output mask (top and right), but I'm not able to locate the exact place in code. This occurs with the X2 super-resolution model and road segmentation model from the Deepness Model ZOO as well with some of my own models.

The edge effects reduce the usability of the results a lot as those on the edges can not be trusted.

@Saareem
Copy link
Contributor Author

Saareem commented Nov 29, 2023

Blue pen is my own annotation, of course.

@przemyslaw-aszkowski
Copy link
Contributor

Hi,
Does it happen when the processed area is unlimited or when the processed area is exactly as the orthophoto? I can't see it on your image, but when I run the road segmentation model from ZOO it looks good (see below)
image

If there is no more data in your orthophoto, it may be just the actual model output, as the model output is often not stable at the edges. Otherwise please provide detailed instructions on how to reproduce it.

By the way, there indeed is an issue with "off by one pixel" #123, but in your screenshot, it looks like dozens of pixels.

Cheers
Przemek

@Saareem
Copy link
Contributor Author

Saareem commented Nov 30, 2023

I was using "Entire layer" option. There seems to be one pixel missing from the full output but only on the right edge... The edge effect is there still.
image

The same happens when I use "Visible part" option
image

It might be partly because my spatial resolution (25 cm/px) is slightly off the model default resolution (21 cm/px). So I tried resampling:

image

It did not help at all. I can share the resampled raster for tests. https://drive.google.com/file/d/1t4HNe2D8-Qvla7rRvqqMQmRcUte6oJrX/view?usp=sharing

@Saareem
Copy link
Contributor Author

Saareem commented Nov 30, 2023

image

There's definitely something strange going on the edges. The background layer and road layer are the only layers reaching to the whole processing extent. The other layers are cut off entirely. I'm using the default settings for the DeebLabV3_landcover4c model from the metadata. However, that 40% overlap seems excessive. With 0 px overlap I get this:
image

It's better in a way but then the only layer reaching the whole processing extent (the raster) is the background layer.

@przemyslaw-aszkowski
Copy link
Contributor

Thanks for the detailed description. We will be looking into the issue once we have some time.
In the meantime, if you want, you can help investigate this issue.
Cheers
Przemek

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

No branches or pull requests

2 participants