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

[Bug]: Output segmentation mask mismatch #1660

Open
1 task done
1713mz opened this issue Jan 23, 2024 · 8 comments
Open
1 task done

[Bug]: Output segmentation mask mismatch #1660

1713mz opened this issue Jan 23, 2024 · 8 comments
Milestone

Comments

@1713mz
Copy link

1713mz commented Jan 23, 2024

Describe the bug

Hello, I have recently found that in the output images the subplots of image/predicted heatmap and groundtruth/predicted mask/segmentation result does not match, see the following image:
003
I am pretty sure it was caused by the centercrop operation. After disabling the parameter the results looks reasonable:
003_new

Dataset

N/A

Model

N/A

Steps to reproduce the behavior

None

OS information

Not relevant

Expected behavior

None

Screenshots

No response

Pip/GitHub

GitHub

What version/branch did you use?

No response

Configuration YAML

Not relevant

Logs

Not relevant

Code of Conduct

  • I agree to follow this project's Code of Conduct
@blaz-r
Copy link
Contributor

blaz-r commented Jan 23, 2024

Hi, thanks for reporting this. It looks very similar to #1447 so I think there is actually a problem with center cropping.
I think the problem arises because inside visualizer the image is loaded again, since the original was normalized:

height, width = batch["image"].shape[-2:]
image = read_image(path=batch["image_path"][i], image_size=(height, width))

I belive this needs to be handled differently. Either we also pass center crop data to visualizer, or we pass the normalization data to de-normalize the image.
Looking at the history, it seems like there used to be a denormalization which was removed due to an issue:

image_result = ImageResult(
image=Denormalize()(batch["image"][i].cpu()),

@samet-akcay do you maybe remember why that was the case and what should be done in this case since visualizing with center-crop seems to be an issue?

@samet-akcay
Copy link
Contributor

Yeah, I think it was to avoid denormalization if i remember correctly, @djdameln?

@ashwinvaidya17 is currently working on #1530. Maybe we could consider addressing it there, or a separate one?

@ashwinvaidya17 ashwinvaidya17 added this to the v1.0.0 milestone Feb 21, 2024
@samet-akcay samet-akcay added the Good First Issue Issues that can be picked up by someone unfamiliar with the repo and would like to contribute. label Feb 26, 2024
@Akash-Chokhani
Copy link

Hi, I would like to work on this issue.

@blaz-r
Copy link
Contributor

blaz-r commented Feb 27, 2024

Sure 😊, thanks.

@samet-akcay
Copy link
Contributor

Thanks @Akash-Chokhani !

@samet-akcay
Copy link
Contributor

Please keep an eye on this PR #1706 as it might cause some conflicts to your work.

We plan to merge it by tomorrow

@Akash-Chokhani
Copy link

Got it. Thanks for letting me know.

@samet-akcay
Copy link
Contributor

We will be able to address this issue with #2358 and #2334

@samet-akcay samet-akcay removed the Good First Issue Issues that can be picked up by someone unfamiliar with the repo and would like to contribute. label Oct 14, 2024
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

5 participants