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

A possible bug in inference.py #10

Open
CWHer opened this issue May 19, 2022 · 0 comments
Open

A possible bug in inference.py #10

CWHer opened this issue May 19, 2022 · 0 comments

Comments

@CWHer
Copy link

CWHer commented May 19, 2022

At line 473 of inference.py, it writes

decision = stroke_decision.view(1, h, w, stroke_num).contiguous().bool()

However, this float to bool convert seems to behave wrongly. It almost always yields all true decisions. (I didn't find a document that specifies the converting rule in PyTorch. However, in other languages, float with non-zero values are treated as true.) Consequently, this causes so-called lattice artifacts in the final result.

image

The following code fixes this issue. 🤗

decision = stroke_decision.view(1, h, w, stroke_num).contiguous() > 0

image

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

1 participant