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

Update inference.py #42

Closed
wants to merge 1 commit into from
Closed

Conversation

DarthThomas
Copy link
Contributor

Bugfix: inconsistent naming & hw mismatch
(Note that this inverse_resize does not always work due to the use of int(): it's possible to generate a one-pixel difference between inversed prediction and the original image emerges)

@hxcai
Copy link
Collaborator

hxcai commented Oct 16, 2020

@DarthThomas why using nearest resize?

@DarthThomas
Copy link
Contributor Author

@DarthThomas why using nearest resize?

Because it's resizing a predicted 0-1 mask.

@DarthThomas
Copy link
Contributor Author

@YuxinZou Here is an example case:

original image size: (506, 675, 3)
transforms:(LongestMaxSize:(1153, 1345), PadIfNeeded:(1153, 1345))

you get output mask shape: (class_number, 1153, 1345)

after 'transpose' and this 'inverse_resize', you get: (578, 674, 2)

after 'inverse_pad', you get: (506, 674, 2)

which is not the same as the original input and will invoke an error in function 'result' when generating 'cover'

@DarthThomas
Copy link
Contributor Author

I'm closing this PR since @YuxinZou is working on it

@DarthThomas DarthThomas deleted the patch-1 branch October 19, 2020 02:35
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

Successfully merging this pull request may close these issues.

None yet

2 participants