Skip to main content

dequant_detect_box

Function dequant_detect_box 

Source
pub fn dequant_detect_box<SCORE: PrimInt + AsPrimitive<f32>>(
    detect: &DetectBoxQuantized<SCORE>,
    quant_scores: Quantization,
) -> DetectBox
Expand description

Turns a DetectBoxQuantized into a DetectBox by dequantizing the score.

ยงExamples

let quant = Quantization::new(0.1, -128);
let bbox = BoundingBox::new(0.1, 0.2, 0.3, 0.4);
let detect_quant = DetectBoxQuantized {
    bbox,
    score: 100_i8,
    label: 1,
};
let detect = dequant_detect_box(&detect_quant, quant);
assert_eq!(detect.score, 0.1 * 100.0 + 12.8);
assert_eq!(detect.label, 1);
assert_eq!(detect.bbox, bbox);