Skip to content

Commit

Permalink
fix: error of sample_points when num_point < far_idx_choice
Browse files Browse the repository at this point in the history
In data_processor.py sample_points, when num_points < far_idx_choice, a negative value is passed into np.random.choice, which cause a ValueError.
In fact the variable `near_idxs_choice` return by the deleted line is never used.
  • Loading branch information
Starrah committed Jan 19, 2021
1 parent a7cf536 commit a8b7ff1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion pcdet/datasets/processor/data_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def sample_points(self, data_dict=None, config=None):
pts_near_flag = pts_depth < 40.0
far_idxs_choice = np.where(pts_near_flag == 0)[0]
near_idxs = np.where(pts_near_flag == 1)[0]
near_idxs_choice = np.random.choice(near_idxs, num_points - len(far_idxs_choice), replace=False)
choice = []
if num_points > len(far_idxs_choice):
near_idxs_choice = np.random.choice(near_idxs, num_points - len(far_idxs_choice), replace=False)
Expand Down

0 comments on commit a8b7ff1

Please sign in to comment.