DriftCapture · function
labelMasks
A name for each mask index, from a detector's boxes.
Explained in DriftCapture.
function labelMasks(view: MaskView, detections: readonly Owlv2Detection[], queries: readonly string[], overlap?: number): (string | null)[]import { labelMasks } from '@driftengine/capture';Parameters
| Parameter | Type | Description |
|---|---|---|
view | MaskView | |
detections | readonly Owlv2Detection[] | |
queries | readonly string[] | |
overlap? | number |
In depth
The join between the two models a capture runs: one says where the things are and the other says what they are called, and neither can do the other's half. A mask takes the name of the detection it agrees with most, measured as intersection over union between the mask's own pixels and the box — the mask's pixels rather than the box around them, because the box around an L-shaped mask is mostly not the mask.
A mask that agrees with nothing gets no name, and that is a result. null here reaches
proposeEntities as scenery, which is the safe answer; a name taken from the nearest box
whatever the overlap is how a chair becomes a table. overlap is where a caller draws that line.