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

Questions about the loss computation #19

Open
w2kun opened this issue Nov 25, 2022 · 5 comments
Open

Questions about the loss computation #19

w2kun opened this issue Nov 25, 2022 · 5 comments

Comments

@w2kun
Copy link

w2kun commented Nov 25, 2022

Hi, thanks for releasing the code!

I have several questions after reading the execute_func.py:

  • At L78, the DPT is initialized with invert=True, which means the output is already depth. While at L253, a division is performed again to convert the output of DPT to depth. Is there a comment error here, since from what I understand, the code at L254 seems to be correct.
  • At L378, the pseudo_depth error is computed between outputs["fromMono_dep"] and outputs[('depth', 0, 0)], which have different scales. Should outputs["fromMono_dep"] be replaced by target_depth at L353, since its scale has been aligned.

Looking forward to your reply.

Best regards!

@choyingw
Copy link
Collaborator

That's an error when we switch to NYU's pretrained model. Please uncomment L64-71 and comment L74-81, and the rest is intact. I'll update it

@choyingw
Copy link
Collaborator

choyingw commented Nov 29, 2022

Just updated. If you use NYU's pretrained model, there is no need to do the inversion since the model's output is directly in meters; otherwise when a general purpose DPT is used (i.e. predicting in disparity space), you need to do inversion

@w2kun
Copy link
Author

w2kun commented Nov 29, 2022

Thanks for your reply! I will try the updated version. Also, I'm wondering if it's correct to modify the code like the second item says?

@baldgirllulu
Copy link

In subsection 3.2 of the paper it is written that“We first estimate rough alignment factors of scale as and shift at from DPT’s output D∗ t to predicted depth Dt by minimizing differences between D¯ ∗ t = asD∗ t + at and Dt with closed-form expressions from the least-square op�timization (see the supplementary” My understanding is that the output of DPT needs to be varied linearly and then with the predicted depth Dt to calculate Statistical loss. but in the code directly using the output of DPT and the predicted depth to calculate the ssim value, and I didn't find any program related to the linear variation, is it my misunderstanding?
Looking forward to your reply.

Best regards!

@baldgirllulu
Copy link

About the second item:I also think scale alignment is needed before computing the loss

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

3 participants