Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenPCDet
Commits
16f9c032
Commit
16f9c032
authored
Jul 02, 2022
by
Shaoshuai Shi
Browse files
change image padding from nan to zero
parent
a481fba1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
9 deletions
+2
-9
pcdet/datasets/dataset.py
pcdet/datasets/dataset.py
+1
-8
pcdet/models/backbones_3d/vfe/image_vfe_modules/ffn/ddn/ddn_template.py
...ackbones_3d/vfe/image_vfe_modules/ffn/ddn/ddn_template.py
+1
-1
No files found.
pcdet/datasets/dataset.py
View file @
16f9c032
...
...
@@ -44,12 +44,6 @@ class DatasetTemplate(torch_data.Dataset):
else
:
self
.
depth_downsample_factor
=
None
self
.
gt_sampler_with_img
=
False
for
augmentor
in
self
.
data_augmentor
.
data_augmentor_queue
:
if
isinstance
(
augmentor
,
DataBaseSampler
):
if
augmentor
.
aug_with_img
:
self
.
gt_sampler_with_img
=
True
@
property
def
mode
(
self
):
return
'train'
if
self
.
training
else
'test'
...
...
@@ -212,8 +206,7 @@ class DatasetTemplate(torch_data.Dataset):
pad_h
=
common_utils
.
get_pad_params
(
desired_size
=
max_h
,
cur_size
=
image
.
shape
[
0
])
pad_w
=
common_utils
.
get_pad_params
(
desired_size
=
max_w
,
cur_size
=
image
.
shape
[
1
])
pad_width
=
(
pad_h
,
pad_w
)
# Pad with nan, to be replaced later in the pipeline.
pad_value
=
0
if
self
.
gt_sampler_with_img
else
np
.
nan
pad_value
=
0
if
key
==
"images"
:
pad_width
=
(
pad_h
,
pad_w
,
(
0
,
0
))
...
...
pcdet/models/backbones_3d/vfe/image_vfe_modules/ffn/ddn/ddn_template.py
View file @
16f9c032
...
...
@@ -151,7 +151,7 @@ class DDNTemplate(nn.Module):
x
=
images
if
self
.
pretrained
:
# Create a mask for padded pixels
mask
=
torch
.
isnan
(
x
)
mask
=
(
x
==
0
)
# Match ResNet pretrained preprocessing
x
=
normalize
(
x
,
mean
=
self
.
norm_mean
,
std
=
self
.
norm_std
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment