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

Fix disparity smoothness missing y gradient #206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

braun-steven
Copy link

In get_disparity_smoothness:

return smoothness_x + smoothness_y
)

the two lists for the x and y direction are concatenated while the loss in your paper suggests to use elementwise addition. To fix this you could either pad the gradients on the right side and bottom by 1 or simply iterate over the 8 instead of 4 elements of the gradients list. Else you disregard the y gradients as the first 4 entries are only the x gradients.

@Songminkee
Copy link

self.disp_left_loss = [tf.reduce_mean(tf.abs(self.disp_left_smoothness[i])) / 2 ** i for i in range(4 * 2)]
self.disp_right_loss = [tf.reduce_mean(tf.abs(self.disp_right_smoothness[i])) / 2 **i for i in range(4 * 2)]

Wouldn't this be better?

self.disp_left_loss = [tf.reduce_mean(tf.abs(self.disp_left_smoothness[i])) / 2 ** (i%4) for i in range(4 * 2)]
self.disp_right_loss = [tf.reduce_mean(tf.abs(self.disp_right_smoothness[i])) / 2 **(i%4) for i in range(4 * 2)]

@asherp7
Copy link

asherp7 commented Jan 5, 2021

When debugging the code I ran into this bug too. I wonder if fixing this will give better results...

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.

3 participants