Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Pass voxel size and pcrange to PillarFeatureNet #2

Merged
merged 1 commit into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions second/pytorch/builder/second_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ def build(model_cfg: second_pb2.VoxelNet, voxel_generator,
loc_loss_ftor=loc_loss_ftor,
cls_loss_ftor=cls_loss_ftor,
target_assigner=target_assigner,
voxel_size=voxel_generator.voxel_size,
pc_range=voxel_generator.point_cloud_range
)
return net
22 changes: 17 additions & 5 deletions second/pytorch/models/voxelnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ def __init__(self,
encode_rad_error_by_sin=False,
loc_loss_ftor=None,
cls_loss_ftor=None,
voxel_size=(0.2, 0.2, 4),
pc_range=(0, -40, -3, 70.4, 40, 1),
name='voxelnet'):
super().__init__()
self.name = name
Expand Down Expand Up @@ -568,11 +570,21 @@ def __init__(self,
"PillarFeatureNet": PillarFeatureNet
}
vfe_class = vfe_class_dict[vfe_class_name]
self.voxel_feature_extractor = vfe_class(
num_input_features,
use_norm,
num_filters=vfe_num_filters,
with_distance=with_distance)
if vfe_class_name == "PillarFeatureNet":
self.voxel_feature_extractor = vfe_class(
num_input_features,
use_norm,
num_filters=vfe_num_filters,
with_distance=with_distance,
voxel_size=voxel_size,
pc_range=pc_range
)
else:
self.voxel_feature_extractor = vfe_class(
num_input_features,
use_norm,
num_filters=vfe_num_filters,
with_distance=with_distance)

print("middle_class_name", middle_class_name)
if middle_class_name == "PointPillarsScatter":
Expand Down