Skip to main content

SegmIouCached

Struct SegmIouCached 

Source
pub struct SegmIouCached<'a> { /* private fields */ }
Expand description

Kernel used by evaluate_segm and evaluate_segm_cached — same semantics as SegmIou but threads a single SegmComputeScratch across every compute call (so the dataset-wide pass amortizes per-cell Vec allocations across the ~36 k anns of a val2017 pass) and optionally consults a SegmGtCache for cross-call GT bbox+area reuse.

The cache reference is generalised through GtCacheRef so the same kernel feeds both the borrowed batch path (evaluate_segm_cached) and the Arc-owned streaming path (Self::with_arc_cache + crate::stream::StreamingEvaluator). Held by Mutex to satisfy Similarity: Send + Sync; the lock is uncontended in single-threaded use.

Implementations§

Source§

impl SegmIouCached<'static>

Source

pub fn with_arc_cache(cache: Arc<SegmGtCache>) -> Self

Construct a streaming-friendly kernel that owns its GT cache via Arc (ADR-0020). The kernel is 'static, so a crate::stream::StreamingEvaluator can store it across the worker thread’s lifetime; the same Arc is held by the FFI CocoDataset handle, so derivations populated on one path are visible to the other.

Trait Implementations§

Source§

impl EvalKernel for SegmIouCached<'_>

Source§

fn kind(&self) -> KernelKind

Discriminator carried in the distributed-eval wire format (ADR-0031) so heterogeneous partials are refused at merge time. Required (no default): every kernel must declare its kind.
Source§

fn build_gt_anns( &self, gt_anns: &[CocoAnnotation], indices: &[usize], image: &ImageMeta, ) -> Result<Vec<SegmAnn>, EvalError>

Build the kernel’s GT annotation slice for one (image, category) cell. indices selects from gt_anns in the order the cell matcher will see.
Source§

fn build_dt_anns( &self, dt_anns: &[CocoDetection], indices: &[usize], image: &ImageMeta, parity_mode: ParityMode, ) -> Result<Vec<SegmAnn>, EvalError>

Build the kernel’s DT annotation slice for one (image, category) cell, in score-descending sorted order matching dt_indices. Read more
Source§

fn extra_gt_ignore(&self, _ann: &CocoAnnotation) -> bool

Optional kernel-specific GT ignore override. Default false (no kernel reason to ignore). Read more
Source§

fn is_keypoints(&self) -> bool

Marker: is this kernel the keypoints (OKS) kernel? Read more
Source§

impl Similarity for SegmIouCached<'_>

Source§

type Annotation = SegmAnn

Per-impl annotation shape. The matching engine sees only the matrix produced by Self::compute; the annotation type stays inside the impl plus its caller.
Source§

fn compute( &self, gts: &[SegmAnn], dts: &[SegmAnn], out: &mut ArrayViewMut2<'_, f64>, ) -> Result<(), EvalError>

Writes the gt × dt similarity matrix into out. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for SegmIouCached<'a>

§

impl<'a> RefUnwindSafe for SegmIouCached<'a>

§

impl<'a> Send for SegmIouCached<'a>

§

impl<'a> Sync for SegmIouCached<'a>

§

impl<'a> Unpin for SegmIouCached<'a>

§

impl<'a> UnsafeUnpin for SegmIouCached<'a>

§

impl<'a> UnwindSafe for SegmIouCached<'a>

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> 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, 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.