Skip to main content

StatRequest

Struct StatRequest 

Source
pub struct StatRequest {
    pub metric: Metric,
    pub iou_threshold: Option<f64>,
    pub area: AreaRng,
    pub max_dets: MaxDetSelector,
    pub category_filter: CategoryFilter,
}
Expand description

One line of a summary plan — describes a single mean to compute.

Fields§

§metric: Metric

AP or AR.

§iou_threshold: Option<f64>

None averages across the IoU ladder; Some(t) pins one row. Looked up against iou_thresholds within an internal absolute tolerance (≈1e-9) at summarize time; values not on the ladder produce EvalError::InvalidConfig.

§area: AreaRng

Area-range bucket on the A-axis.

§max_dets: MaxDetSelector

How to pick the M-axis entry.

§category_filter: CategoryFilter

K-axis subset (ADR-0026 D2). Defaults to CategoryFilter::All for COCO-shape plans; LVIS plans use CategoryFilter::Frequency for the AP_r/c/f buckets.

Implementations§

Source§

impl StatRequest

Source

pub const fn new( metric: Metric, iou_threshold: Option<f64>, area: AreaRng, max_dets: MaxDetSelector, ) -> Self

Convenience constructor. const-callable so coco_detection_default and downstream user-defined plans can be assembled in const contexts. Defaults category_filter to CategoryFilter::All.

Source

pub const fn new_with_filter( metric: Metric, iou_threshold: Option<f64>, area: AreaRng, max_dets: MaxDetSelector, category_filter: CategoryFilter, ) -> Self

Construct with a non-default CategoryFilter in one shot. const-callable for the Frequency and All variants; ByIds carries a heap-allocated Vec<CategoryId> and is constructed at runtime.

Source

pub const fn coco_detection_default() -> [Self; 12]

The canonical 12-entry pycocotools detection plan, in the [AP, AP50, AP75, AP_S, AP_M, AP_L, AR_1, AR_10, AR_100, AR_S, AR_M, AR_L] order. Bit-exact with cocoeval is by construction: summarize_detection is just summarize_with(.., this, ..).

Source

pub const fn lvis_default() -> [Self; 13]

The canonical 13-entry LVIS detection plan (ADR-0026 AF1, AF4), in the LVIS print_results order:

[AP, AP50, AP75, APs, APm, APl, APr, APc, APf, AR@300, ARs@300, ARm@300, ARl@300]

Differences from Self::coco_detection_default:

  • 9 AP entries vs 6. Three additional rows (APr/APc/APf) filter the K-axis by Frequency tag. lvis-api reports them as separate entries, not Breakdown axes (ADR-0016 f64-keyed type doesn’t fit categorical tags).
  • 4 AR entries vs 6. No AR@1 / AR@10 / AR@100 — LVIS reports recall at max_dets=300 only (AF4). The Largest selector resolves to whatever the user passes; pair the plan with max_dets=[300] for parity with LVISEval.

Frequency-filtered entries route through summarize_with_lvis; calling summarize_with on this plan returns EvalError::InvalidConfig (the plain entry point has no K-axis context).

Source

pub const fn coco_keypoints_default() -> [Self; 10]

The canonical 10-entry pycocotools keypoints plan, in the [AP, AP50, AP75, AP_M, AP_L, AR, AR50, AR75, AR_M, AR_L] order (cocoeval.py:478-499 under iouType="keypoints").

Differs from Self::coco_detection_default in three ways, all per ADR-0012:

  • 10 entries, not 12 — the small-area row is dropped on both AP and AR (quirk D5).
  • Every entry uses MaxDetSelector::Largest, which resolves to the kp-canonical (20,) ladder; there are no AR_1 / AR_10 / AR_100 rows because the kp ladder has only one rung.
  • The AreaRng indices 0/1/2 (all/medium/large) are re-indexed for the kp A-axis. Callers must pair this plan with crate::AreaRange::keypoints_default so the A-axis indices line up; the const AreaRng::ALL / MEDIUM / LARGE carry the four-bucket detection-grid indices and would index off the end of a three-bucket accumulator.

Trait Implementations§

Source§

impl Clone for StatRequest

Source§

fn clone(&self) -> StatRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StatRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.