Skip to content

Conversation

Ardorax
Copy link
Contributor

@Ardorax Ardorax commented Sep 2, 2022

Change the way of representing an augmented tensor. Clearer separation between property with new separator and without unnecessary ones.


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

- Crash on augmented tensor's '__repr__' function when one element of proprety's array is None.

Signed-off-by: Valentin Dury <[email protected]>
- Useless separator beetween property

Signed-off-by: Valentin Dury <[email protected]>
@Ardorax Ardorax added bug Something isn't working aloscene aloscene quick-fix labels Sep 2, 2022
@Ardorax Ardorax self-assigned this Sep 2, 2022
@Ardorax Ardorax linked an issue Sep 2, 2022 that may be closed by this pull request
@Ardorax
Copy link
Contributor Author

Ardorax commented Sep 2, 2022

Old way:
baseline=0.5372559229941272, projection=pinhole, distortion=1.0, normalization=255, mask={2:torch.Size([2, 1, 370, 1224]),3:torch.Size([2, 1, 370, 1224]),}cam_intrinsic=torch.Size([2, 3, 4])cam_extrinsic=torch.Size([2, 4, 4])flow={flow_occ:[2, 2], flow_noc:[2, 2], }disparity={warped_disp_noc:torch.Size([2, 1, 370, 1224]),warped_disp_occ:torch.Size([2, 1, 370, 1224]),}scene_flow={'[3, 3]'},
New way:
baseline=0.5327254400790535; projection=pinhole; distortion=1.0; normalization=255 mask={1:torch.Size([2, 1, 375, 1242]), 3:torch.Size([2, 1, 375, 1242]), 6:torch.Size([2, 1, 375, 1242]), 7:torch.Size([2, 1, 375, 1242])}; cam_intrinsic=torch.Size([2, 3, 4]); cam_extrinsic=torch.Size([2, 4, 4]); flow={flow_occ:[2, 2], flow_noc:[2, 2]}; disparity={warped_disp_noc:torch.Size([2, 1, 375, 1242]), warped_disp_occ:torch.Size([2, 1, 375, 1242])}; scene_flow=[3, 3]

Should I add more linebreak to improve readability but it will take more space ?

Copy link
Collaborator

@Data-Iab Data-Iab left a comment

Choose a reason for hiding this comment

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

I believe that line breaks sorted in an ascending length would give better readability

distortion=1.0
scene_flow=[3, 3]
normalization=255
projection=pinhole
baseline=0.5327254400790535
cam_intrinsic=torch.Size([2, 3, 4])
cam_extrinsic=torch.Size([2, 4, 4])
mask={1:torch.Size([2, 1, 375, 1242])
flow={flow_occ:[2, 2], flow_noc:[2, 2]}
warped_disp_occ:torch.Size([2, 1, 375, 1242])}
disparity={warped_disp_noc:torch.Size([2, 1, 375, 1242])

+ Print property separated by line break and sorted in length ascending order.

Signed-off-by: Valentin Dury <[email protected]>
@thibo73800 thibo73800 merged commit 23033db into master Sep 9, 2022
@thibo73800 thibo73800 deleted the augmented_tensors_repr branch September 9, 2022 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aloscene aloscene bug Something isn't working quick-fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible print of torch.cat([frame, other_frame], dim=0)
3 participants