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>
impl SegmIouCached<'static>
Sourcepub fn with_arc_cache(cache: Arc<SegmGtCache>) -> Self
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<'_>
impl EvalKernel for SegmIouCached<'_>
Source§fn kind(&self) -> KernelKind
fn kind(&self) -> KernelKind
Source§fn build_gt_anns(
&self,
gt_anns: &[CocoAnnotation],
indices: &[usize],
image: &ImageMeta,
) -> Result<Vec<SegmAnn>, EvalError>
fn build_gt_anns( &self, gt_anns: &[CocoAnnotation], indices: &[usize], image: &ImageMeta, ) -> Result<Vec<SegmAnn>, EvalError>
(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>
fn build_dt_anns( &self, dt_anns: &[CocoDetection], indices: &[usize], image: &ImageMeta, parity_mode: ParityMode, ) -> Result<Vec<SegmAnn>, EvalError>
(image, category)
cell, in score-descending sorted order matching dt_indices. Read moreSource§fn extra_gt_ignore(&self, _ann: &CocoAnnotation) -> bool
fn extra_gt_ignore(&self, _ann: &CocoAnnotation) -> bool
false (no
kernel reason to ignore). Read moreSource§fn is_keypoints(&self) -> bool
fn is_keypoints(&self) -> bool
Source§impl Similarity for SegmIouCached<'_>
impl Similarity for SegmIouCached<'_>
Source§type Annotation = SegmAnn
type Annotation = SegmAnn
Self::compute; the annotation type stays
inside the impl plus its caller.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> 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> 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.