".github/git@developer.sourcefind.cn:orangecat/ollama.git" did not exist on "4d4f75a8a8a349e73dfd85ec0737ad42f5171eb0"
Unverified Commit 70980ad6 authored by Wenwei Zhang's avatar Wenwei Zhang Committed by GitHub
Browse files

[Fix]: fix image pad shape bug in PointFusion (#162)

parent 2492836b
......@@ -170,7 +170,12 @@ class MVXTwoStageDetector(Base3DDetector):
def extract_img_feat(self, img, img_metas):
"""Extract features of images."""
if self.with_img_backbone:
if self.with_img_backbone and img is not None:
input_shape = img.shape[-2:]
# update real input shape of each single img
for img_meta in img_metas:
img_meta.update(input_shape=input_shape)
if img.dim() == 5 and img.size(0) == 1:
img.squeeze_()
elif img.dim() == 5 and img.size(0) > 1:
......
......@@ -277,9 +277,6 @@ class PointFusion(nn.Module):
for i in range(len(img_metas)):
mlvl_img_feats = []
for level in range(len(self.img_levels)):
if torch.isnan(img_ins[level][i:i + 1]).any():
import pdb
pdb.set_trace()
mlvl_img_feats.append(
self.sample_single(img_ins[level][i:i + 1], pts[i][:, :3],
img_metas[i]))
......@@ -330,7 +327,7 @@ class PointFusion(nn.Module):
pcd_scale_factor,
pcd_flip=pcd_flip,
img_flip=img_flip,
img_pad_shape=img_meta['pad_shape'][:2],
img_pad_shape=img_meta['input_shape'][:2],
img_shape=img_meta['img_shape'][:2],
aligned=self.aligned,
padding_mode=self.padding_mode,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment