vis4d.op.box.samplers.combined

Combined Sampler.

Classes

CombinedSampler(*args, pos_strategy, ...[, ...])

Combined sampler.

class CombinedSampler(*args, pos_strategy, neg_strategy, neg_pos_ub=3.0, floor_thr=-1.0, floor_fraction=0.0, num_bins=3, bg_label=0, **kwargs)[source]

Combined sampler. Can have different strategies for pos/neg samples.

Creates an instance of the class.

forward(matching)[source]

Sample boxes according to strategies defined in cfg.

Return type:

SamplingResult

static instance_balanced_sampling(idx_tensor, assigned_gts, assigned_gt_ious, sample_size)[source]

Sample indices with balancing according to matched GT instance.

Return type:

Tensor

iou_balanced_sampling(idx_tensor, assigned_gts, assigned_gt_ious, sample_size)[source]

Sample indices with balancing according to IoU with matched GT.

Return type:

Tensor

sample_within_intervals(idx_tensor, assigned_gt_ious, sample_size)[source]

Sample according to N iou intervals where N = num bins.

Return type:

Tensor