VoteNet
VoteNet detection loss: deep Hough voting target assignment and multi-task objective.
Classes:
-
VoteNetLoss–Multi-task VoteNet detection loss (vote, objectness, box, semantic).
VoteNetLoss
¶
VoteNetLoss(
num_heading_bin: int,
num_size_cluster: int,
num_classes: int,
mean_sizes: Union[Tensor, List[List[float]]],
*,
near_threshold: float = 0.3,
far_threshold: float = 0.6,
objectness_weights: Tuple[float, float] = (0.2, 0.8),
loss_scale: float = 10.0,
)
Bases: Module
Multi-task VoteNet detection loss (vote, objectness, box, semantic).
Reference: Qi et al., 2019.
Proposals are matched to ground-truth objects by nearest center: a proposal is positive when its
nearest GT center is within near_threshold, negative beyond far_threshold, and ignored in the
band between. Positives drive the center, heading, size and semantic terms; the vote term pulls
each object seed's vote toward its object center (the closest of up to three candidate votes).
Parameters:
-
num_heading_bin(int) –Number of heading-angle bins (\(1\) for axis-aligned ScanNet, \(12\) for SUN RGB-D).
-
num_size_cluster(int) –Number of size templates.
-
num_classes(int) –Number of semantic classes.
-
mean_sizes(Union[Tensor, List[List[float]]]) –Per-template mean box size, shape \((\text{num\_size\_cluster}, 3)\).
-
near_threshold(float, default:0.3) –Distance (meters) below which a proposal is a positive object match.
-
far_threshold(float, default:0.6) –Distance (meters) above which a proposal is a negative match.
-
objectness_weights(Tuple[float, float], default:(0.2, 0.8)) –Cross-entropy class weights \([\text{negative}, \text{positive}]\).
-
loss_scale(float, default:10.0) –Global multiplier applied to the summed loss.
Methods:
-
forward–Compute the VoteNet loss and its components.
forward
¶
Compute the VoteNet loss and its components.
Parameters:
-
output(Dict[str, Tensor]) –The model's raw output: dense head tensors (
objectness_scores,center,heading_scores,heading_residuals_normalized,size_scores,size_residuals_normalized,sem_cls_scores,pos_vote_aggr) as \((B, K, \cdot)\), plus the packedpos_seed,pos_vote\((S, 3)\) andseed_indices,batch_seed,batch_vote\((S,)\). -
batch(Dict[str, Any]) –Ground truth (
center_label,heading_class_label,heading_residual_label,size_class_label,size_residual_label,sem_cls_label,box_label_maskas \((B, M, \cdot)\), per-pointvote_label\((B, N, 9)\),vote_label_mask\((B, N)\), and the per-pointbatchindex). The heading labels are binned from counter-clockwise headings and re-binned internally into the model's native (negated) heading space.
Returns:
-
Dict[str, Tensor]–A dict with the scalar
loss(to backprop) and detachedvote_loss,objectness_loss, -
Dict[str, Tensor]–box_loss,center_loss,heading_cls_loss,heading_res_loss,size_cls_loss, -
Dict[str, Tensor]–size_res_loss,sem_cls_lossandobj_accdiagnostics.