pub struct Bucket {
pub index: usize,
pub label: Cow<'static, str>,
pub lo: f64,
pub hi: f64,
}Expand description
One bucket on a Breakdown.
A bucket carries everything the per-image orchestrator and the
summarizer need to slice a single A-axis cell: the inclusive [lo, hi] range used to test annotation membership, the label rendered in
the summary table, and the index position on the
crate::Accumulated A-axis where the cell’s outputs land.
Inclusivity. [lo, hi] is closed on both ends, mirroring
pycocotools’ cocoeval.py:251 predicate not (area < lo or area > hi) (quirk D6 strict). An annotation whose key sits exactly on
a boundary lands in both adjacent buckets. This is not the
half-open convention Range<f64> would imply — buckets are not a
partition, they are an overlap-tolerant cover.
Fields§
§index: usizeA-axis position. 0 is conventionally the all bucket on
area-keyed Breakdowns.
label: Cow<'static, str>Label rendered by the summarizer (e.g. "all", "small",
"medium", "large" for area; "easy", "hard" for a future
CrowdPose breakdown).
lo: f64Lower bound (inclusive — quirks D6/D7).
hi: f64Upper bound (inclusive — quirks D6/D7). Use AREA_UNBOUNDED
(1e10) for “no upper bound”; pycocotools uses exactly that
value for the all and large buckets.
Implementations§
Source§impl Bucket
impl Bucket
Sourcepub const fn from_static(
index: usize,
label: &'static str,
lo: f64,
hi: f64,
) -> Self
pub const fn from_static( index: usize, label: &'static str, lo: f64, hi: f64, ) -> Self
const-friendly constructor for compile-time string labels.
Sourcepub fn new(
index: usize,
label: impl Into<Cow<'static, str>>,
lo: f64,
hi: f64,
) -> Self
pub fn new( index: usize, label: impl Into<Cow<'static, str>>, lo: f64, hi: f64, ) -> Self
Constructor for owned-string labels (e.g., labels built at runtime from a config file).
Sourcepub fn contains(&self, key: f64) -> bool
pub fn contains(&self, key: f64) -> bool
true when key falls inside [lo, hi] (closed on both ends —
quirks D6/D7).
Sourcepub fn to_area_range(&self) -> AreaRange
pub fn to_area_range(&self) -> AreaRange
Lift this bucket into the AreaRange shape the per-image
orchestrator consumes.
Sourcepub fn to_area_rng(&self) -> AreaRng
pub fn to_area_rng(&self) -> AreaRng
Lift this bucket into the AreaRng shape the summarizer
consumes.
Trait Implementations§
impl StructuralPartialEq for Bucket
Auto Trait Implementations§
impl Freeze for Bucket
impl RefUnwindSafe for Bucket
impl Send for Bucket
impl Sync for Bucket
impl Unpin for Bucket
impl UnsafeUnpin for Bucket
impl UnwindSafe for Bucket
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.