Commit 3b0ae48c authored by Erli Ouyang's avatar Erli Ouyang Committed by ZwwWayne
Browse files

Update iou_neg_piecewise_sampler.py (#2017)

fix lint
parent aa544d4a
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import math
import torch import torch
from mmdet3d.registry import TASK_UTILS from mmdet3d.registry import TASK_UTILS
...@@ -74,9 +76,11 @@ class IoUNegPiecewiseSampler(RandomSampler): ...@@ -74,9 +76,11 @@ class IoUNegPiecewiseSampler(RandomSampler):
# if the numbers of negative samplers in previous # if the numbers of negative samplers in previous
# pieces are less than the expected number, extend # pieces are less than the expected number, extend
# the same number in the current piece. # the same number in the current piece.
piece_expected_num = int( piece_expected_num = min(
num_expected * num_expected,
self.neg_piece_fractions[piece_inds]) + extend_num math.ceil(num_expected *
self.neg_piece_fractions[piece_inds]) +
extend_num)
min_iou_thr = self.neg_iou_thr[piece_inds + 1] min_iou_thr = self.neg_iou_thr[piece_inds + 1]
max_iou_thr = self.neg_iou_thr[piece_inds] max_iou_thr = self.neg_iou_thr[piece_inds]
piece_neg_inds = torch.nonzero( piece_neg_inds = torch.nonzero(
......
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