pub trait BBoxTypeTrait {
// Required methods
fn to_xyxy_float<A: Float + 'static, B: AsPrimitive<A>>(
input: &[B; 4],
) -> [A; 4];
fn to_xyxy_dequant<A: Float + 'static, B: AsPrimitive<A>>(
input: &[B; 4],
quant: Quantization,
) -> [A; 4]
where f32: AsPrimitive<A>,
i32: AsPrimitive<A>;
// Provided methods
fn ndarray_to_xyxy_float<A: Float + 'static, B: AsPrimitive<A>>(
input: ArrayView1<'_, B>,
) -> [A; 4] { ... }
fn ndarray_to_xyxy_dequant<A: Float + 'static, B: AsPrimitive<A>>(
input: ArrayView1<'_, B>,
quant: Quantization,
) -> [A; 4]
where f32: AsPrimitive<A>,
i32: AsPrimitive<A> { ... }
}Expand description
Trait to convert bounding box formats to XYXY float format
Required Methods§
Sourcefn to_xyxy_float<A: Float + 'static, B: AsPrimitive<A>>(
input: &[B; 4],
) -> [A; 4]
fn to_xyxy_float<A: Float + 'static, B: AsPrimitive<A>>( input: &[B; 4], ) -> [A; 4]
Converts the bbox into XYXY float format.
Sourcefn to_xyxy_dequant<A: Float + 'static, B: AsPrimitive<A>>(
input: &[B; 4],
quant: Quantization,
) -> [A; 4]
fn to_xyxy_dequant<A: Float + 'static, B: AsPrimitive<A>>( input: &[B; 4], quant: Quantization, ) -> [A; 4]
Converts the bbox into XYXY float format.
Provided Methods§
Sourcefn ndarray_to_xyxy_float<A: Float + 'static, B: AsPrimitive<A>>(
input: ArrayView1<'_, B>,
) -> [A; 4]
fn ndarray_to_xyxy_float<A: Float + 'static, B: AsPrimitive<A>>( input: ArrayView1<'_, B>, ) -> [A; 4]
Converts the bbox into XYXY float format.
§Examples
let arr = array![10.0_f32, 20.0, 20.0, 20.0];
let xyxy: [f32; 4] = XYWH::ndarray_to_xyxy_float(arr.view());
assert_eq!(xyxy, [0.0_f32, 10.0, 20.0, 30.0]);Sourcefn ndarray_to_xyxy_dequant<A: Float + 'static, B: AsPrimitive<A>>(
input: ArrayView1<'_, B>,
quant: Quantization,
) -> [A; 4]
fn ndarray_to_xyxy_dequant<A: Float + 'static, B: AsPrimitive<A>>( input: ArrayView1<'_, B>, quant: Quantization, ) -> [A; 4]
Converts the bbox into XYXY float format.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".