"test/vscode:/vscode.git/clone" did not exist on "dccf52f9c8b2da0daadf0630b9754488ad3d252f"
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): ...@@ -170,7 +170,12 @@ class MVXTwoStageDetector(Base3DDetector):
def extract_img_feat(self, img, img_metas): def extract_img_feat(self, img, img_metas):
"""Extract features of images.""" """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: if img.dim() == 5 and img.size(0) == 1:
img.squeeze_() img.squeeze_()
elif img.dim() == 5 and img.size(0) > 1: elif img.dim() == 5 and img.size(0) > 1:
......
...@@ -277,9 +277,6 @@ class PointFusion(nn.Module): ...@@ -277,9 +277,6 @@ class PointFusion(nn.Module):
for i in range(len(img_metas)): for i in range(len(img_metas)):
mlvl_img_feats = [] mlvl_img_feats = []
for level in range(len(self.img_levels)): 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( mlvl_img_feats.append(
self.sample_single(img_ins[level][i:i + 1], pts[i][:, :3], self.sample_single(img_ins[level][i:i + 1], pts[i][:, :3],
img_metas[i])) img_metas[i]))
...@@ -330,7 +327,7 @@ class PointFusion(nn.Module): ...@@ -330,7 +327,7 @@ class PointFusion(nn.Module):
pcd_scale_factor, pcd_scale_factor,
pcd_flip=pcd_flip, pcd_flip=pcd_flip,
img_flip=img_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], img_shape=img_meta['img_shape'][:2],
aligned=self.aligned, aligned=self.aligned,
padding_mode=self.padding_mode, 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