pub struct CocoAnnotation {
pub id: AnnId,
pub image_id: ImageId,
pub category_id: CategoryId,
pub area: f64,
pub is_crowd: bool,
pub ignore_flag: Option<bool>,
pub bbox: Bbox,
pub segmentation: Option<Segmentation>,
pub keypoints: Option<Vec<f64>>,
pub num_keypoints: Option<u32>,
}Expand description
A COCO annotation as stored on the dataset side (ground truth).
Detection annotations follow a separate path — see the future
loadRes-equivalent — because their iscrowd is always 0 (quirk
E2) and their area is auto-derived (quirk J3). Conflating
the two would let a DT bug silently corrupt GT semantics.
Fields§
§id: AnnIdAnnotation id (preserved verbatim from JSON).
image_id: ImageIdImage this annotation belongs to.
category_id: CategoryIdCategory this annotation belongs to.
area: f64Pixel area as recorded in JSON. For GT, COCO stores this directly; we trust the field.
is_crowd: boolCrowd flag (the COCO iscrowd field). pycocotools coerces this
to bool via truthiness, so 0/1 ints round-trip identically.
ignore_flag: Option<bool>Optional explicit ignore flag.
None means the JSON had no ignore field. pycocotools (quirk
D1) silently overwrites whatever was here with is_crowd;
vernier preserves it and lets Self::effective_ignore resolve
the strict vs corrected disposition at eval time.
bbox: BboxBounding box. Required for every COCO ground-truth annotation
(even keypoint-only annotations carry a bbox; the bbox is what
J3 derives DT-area from). Phase 3 adds keypoints as an
additional optional field.
segmentation: Option<Segmentation>COCO segmentation field, in any of the three shapes
pycocotools accepts (multi-polygon, uncompressed RLE,
compressed RLE). None for keypoint-only annotations or
fixtures that omit it. The matching engine normalizes via
Segmentation::to_rle at eval time.
keypoints: Option<Vec<f64>>Flat keypoint triplets [x_1, y_1, v_1, x_2, y_2, v_2, ...]
(per ADR-0012). None for non-keypoint annotations; the eval
pipeline raises EvalError::InvalidAnnotation when a GT is
missing keypoints under iouType="keypoints".
num_keypoints: Option<u32>COCO num_keypoints count of visible keypoints (v > 0),
per ADR-0012. pycocotools precomputes this on GT (driving the
quirk D2 implicit-ignore branch); on DT it is not required
and is derived from keypoints when needed.
Implementations§
Source§impl CocoAnnotation
impl CocoAnnotation
Sourcepub fn effective_ignore(&self, mode: ParityMode) -> bool
pub fn effective_ignore(&self, mode: ParityMode) -> bool
Resolves the effective ignore flag for this annotation under a given parity mode (per ADR-0002 / quirk D1).
Strictreproduces pycocotools: the user’signorefield is discarded, andignoreis set tois_crowd.Correctedhonors the user’s explicitignorefield when present; falls back tois_crowdwhen absent.
Trait Implementations§
Source§impl Annotation for CocoAnnotation
impl Annotation for CocoAnnotation
Source§fn category_id(&self) -> CategoryId
fn category_id(&self) -> CategoryId
Source§fn effective_ignore(&self, mode: ParityMode) -> bool
fn effective_ignore(&self, mode: ParityMode) -> bool
Source§impl Clone for CocoAnnotation
impl Clone for CocoAnnotation
Source§fn clone(&self) -> CocoAnnotation
fn clone(&self) -> CocoAnnotation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CocoAnnotation
impl Debug for CocoAnnotation
Source§impl<'de> Deserialize<'de> for CocoAnnotation
impl<'de> Deserialize<'de> for CocoAnnotation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CocoAnnotation
impl PartialEq for CocoAnnotation
Source§fn eq(&self, other: &CocoAnnotation) -> bool
fn eq(&self, other: &CocoAnnotation) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CocoAnnotation
impl Serialize for CocoAnnotation
impl StructuralPartialEq for CocoAnnotation
Auto Trait Implementations§
impl Freeze for CocoAnnotation
impl RefUnwindSafe for CocoAnnotation
impl Send for CocoAnnotation
impl Sync for CocoAnnotation
impl Unpin for CocoAnnotation
impl UnsafeUnpin for CocoAnnotation
impl UnwindSafe for CocoAnnotation
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.