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
65
66
67
68
69
70
71
72
73
74
75
//! The conformance suite every vision backend runs (spec 3.7 ยง7.18), feature `conformance`.
//!
//! | Trait | Test macro | Cases |
//! |-------|------------|-------|
//! | [`Detector`] | [`detector_conformance_tests!`](crate::detector_conformance_tests) | coordinates, usage, cancellation, kill switch, egress, oversized input, unreleased images |
//! | [`Segmenter`] | [`segmenter_conformance_tests!`](crate::segmenter_conformance_tests) | the same |
//! | [`DocumentReader`] | [`document_reader_conformance_tests!`](crate::document_reader_conformance_tests) | the same |
//! | [`Describer`] | [`describer_conformance_tests!`](crate::describer_conformance_tests) | the same, coordinates when the backend returns regions |
//! | [`Embedder`] | [`embedder_conformance_tests!`](crate::embedder_conformance_tests) | usage, cancellation, kill switch, egress, oversized input, unreleased images, dimensions |
//! | [`Editor`] | [`editor_conformance_tests!`](crate::editor_conformance_tests) | the same, provenance |
//! | [`Tracker`](crate::Tracker) | [`tracker_conformance_tests!`](crate::tracker_conformance_tests) | stable identifiers, new objects, reset |
//! | [`VideoAnalyzer`](crate::VideoAnalyzer) | [`video_analyzer_conformance_tests!`](crate::video_analyzer_conformance_tests) | usage, egress, event times and track regions, unsupported requests, cancellation, kill switch, frame cap, unreleased media |
//!
//! Every case runs the backend through a [`VisionRuntime`](crate::VisionRuntime), so the image it sees, the
//! metering, the egress gate and the mapping to source pixels are the ones production uses:
//!
//! - **Coordinates.** Regions are in source pixels within the fixture's tolerance, belong to
//! the fixture image, lie inside it, and carry the backend, its frame and the transform
//! chain (a resize recorded exactly when the backend's limit required one).
//! - **Usage.** Every call records its images as units, at zero cost for a local backend
//! and at its unit price for a per-unit one.
//! - **Cancellation and the kill switch.** A cancelled call ends with `Cancelled`, within
//! one call for a slow backend; a frozen kill switch refuses before the backend runs.
//! - **Egress.** A local backend leaves the egress recorder empty; a remote backend's every
//! image is a recorded release. A remote backend without an egress gate is refused, and
//! handing it an unreleased image does not compile (see [`SentImage`](crate::SentImage)).
//! - **Oversized input.** Refused with the limit in the message, or downscaled with the
//! resize recorded, as the descriptor says.
//! - **Errors.** A rate-limited backend maps to `RateLimited` with a retry hint.
//! - **Video.** A video call records its frames as `UsageUnit::Frames`; event times are
//! milliseconds from the start of the video, ordered and inside it; track regions are in
//! source pixels of the clip or their frame; an unsupported request, a cancelled call, the
//! kill switch and a frame cap each refuse before anything leaves.
//!
//! The macros expand to `#[tokio::test]`s on a multi-threaded runtime, so the calling crate
//! needs `tokio` with the `macros` and `rt-multi-thread` features. Invoke each macro in its
//! own module.
//!
//! # Example
//!
//! ```rust,ignore
//! mod my_detector {
//! use std::sync::Arc;
//! use adk_vision::conformance::DetectorTarget;
//!
//! adk_vision::detector_conformance_tests! {
//! backend = DetectorTarget::Local(Arc::new(my_crate::MyDetector::new())),
//! }
//! }
//! ```
pub use *;
pub use ;
pub use *;
use crateReleasedImage;
use crate;
/// A detector under test.
pub type DetectorTarget = ;
/// A segmenter under test.
pub type SegmenterTarget = ;
/// A document reader under test.
pub type ReaderTarget = ;
/// An embedder under test.
pub type EmbedderTarget = ;
/// A describer under test.
pub type DescriberTarget = ;
/// An editor under test.
pub type EditorTarget = ;