Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sunjiahao1999 committed Feb 15, 2023
1 parent 5c50239 commit 8b8cf9e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mmdet3d/datasets/transforms/formating.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def pack_single_results(self, results: dict) -> dict:
img = results['img']
if len(img.shape) < 3:
img = np.expand_dims(img, -1)
# To improve the computational speed by by 3-5 times, apply:
# `torch.permute()` rather than `np.transpose()`.
# Refer to https://github.com/open-mmlab/mmdetection/pull/9533
# for more details
results['img'] = to_tensor(img).permute(2, 0, 1).contiguous()

for key in [
Expand Down

0 comments on commit 8b8cf9e

Please # to comment.