1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Intermediate Representation (IR) for panlabel.
//!
//! This module defines the canonical, format-agnostic representation of
//! object detection datasets. It serves as the central "hub" that all
//! format conversions pass through, similar to how Pandoc uses an internal
//! AST for document conversion.
//!
//! # Design Principles
//!
//! 1. **Type Safety**: Use newtypes and marker types to prevent common errors
//! at compile time (e.g., mixing pixel and normalized coordinates).
//!
//! 2. **Canonical Format**: The IR uses a single, well-defined coordinate
//! system (XYXY in pixel space) to avoid ambiguity.
//!
//! 3. **Permissive Construction**: IR types allow "invalid" data to be
//! represented (e.g., negative coordinates), so that validation can
//! report issues rather than panic during parsing.
//!
//! # Example
//!
//! ```
//! use panlabel::ir::{Dataset, Image, Category, Annotation, BBoxXYXY, Pixel};
//!
//! let dataset = Dataset {
//! images: vec![Image::new(1u64, "image.jpg", 640, 480)],
//! categories: vec![Category::new(1u64, "person")],
//! annotations: vec![
//! Annotation::new(
//! 1u64, 1u64, 1u64,
//! BBoxXYXY::<Pixel>::from_xyxy(10.0, 20.0, 100.0, 200.0),
//! )
//! ],
//! ..Default::default()
//! };
//! ```
// Re-export core types for convenient access
pub use BBoxXYXY;
pub use Coord;
pub use ;
pub use ;
pub use ;