Skip to content

Conversation

anhtu293
Copy link
Contributor

@anhtu293 anhtu293 commented Apr 5, 2023

General description of your pull request with the list of new features and/or bugs.

This bug was fixed in dev branch with this PR. However, we still use torch1.13, so i do this PR for v0.5.2 in waiting for the dev officially supported.

  • How to fix: remove unsqueeze in encode_abosolute
  • Result after fixing
>>> from aloscene import Depth
>>> import torch
>>> depth = Depth(torch.zeros((1, 128, 128)), is_absolute=False)
>>> depth.encode_absolute()
tensor(
	scale=1
	shift=0
	distortion=1.0
	is_planar=True
	is_absolute=True
	projection=pinhole
	[[[100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         ...,
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.]]])
>>> depth.encode_absolute(keep_negative=True)
tensor(
	scale=1
	shift=0
	distortion=1.0
	is_planar=True
	is_absolute=True
	projection=pinhole
	[[[100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         ...,
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.],
         [100000000., 100000000., 100000000.,  ..., 100000000.,
          100000000., 100000000.]]])
>>> 


This pull request includes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@anhtu293 anhtu293 requested a review from Data-Iab April 5, 2023 09:31
@anhtu293 anhtu293 self-assigned this Apr 5, 2023
@thibo73800 thibo73800 merged commit 7b98304 into master Apr 6, 2023
@thibo73800 thibo73800 deleted the fix_depth_encode_abs branch April 6, 2023 12:17
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.

2 participants