Skip to content

Conversation

Data-Iab
Copy link
Collaborator

Two methods added to Depth:

  • encode_inverse : invert depth with given scale and shift.
  • encode_absolute : undo encode_inverse changes.

One method added to AugTensor:

  • to_squeezed_numpy: as its name indicates, converts to squeezed numpy.

@Data-Iab Data-Iab self-assigned this Mar 22, 2022
@Data-Iab Data-Iab requested a review from thibo73800 March 22, 2022 08:16
Copy link
Contributor

@thibo73800 thibo73800 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once this last comment is solved + the pr description updated, we're gonna be ready to merge. I'll also ask @jsalotti to review since it could happen to use theses methods soon.

@thibo73800
Copy link
Contributor

@jsalotti Can you quickly review this merge request. It propose some method that you might use at some point.

@thibo73800 thibo73800 requested a review from jsalotti March 22, 2022 15:21
Copy link
Contributor

@jsalotti jsalotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The transformations are not consistent. Calling encode_absolute after encode_inverse will not give you the original value. This is due to the order in which you apply substraction and division.
  • encode_inverse does not seem consistent with the convention of this paper. They apply scale and shift directly on idepth, whereas you apply it on depth before inversion. Is it on purpose ?
  • in encode_inverse, it seems that the depth is modified in place instead of creating a copy to return an inverse depth

@Data-Iab
Copy link
Collaborator Author

  • You're right, it's fixed now
  • the encode_inverse is nothing but this with custom scale and shift.
  • issue : the is_inverse change in "depth" when encode_inverse is called.

@Data-Iab
Copy link
Collaborator Author

It seems that we had a problem with functions name. Calling DPT with invert=False means that predictions are inverted (which is not compatible with the attribute name. here invert depth is returned). And so we can't call our function encode_inverse because there will be more ambiguity.
Hence, I changed methods names so encode_absolute is called to transform depth prediction.

dpt = DPT(invert=False)
depth = dpt(frame)  # inverted predicted depth
depth = depth.encode_absolute(shift=shift, scale=scale) # absolute depth

incode_inverse is called just to undo encode_absolute changes

@thibo73800
Copy link
Contributor

@Data-Iab Sounds good. I think there is still a last comment unresolved

@thibo73800 thibo73800 merged commit 778fa2a into master Mar 25, 2022
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