pub struct LiveCamera { /* private fields */ }Expand description
One camera on the frame pipeline: its facts, its source, and the pipeline’s stages.
Frames are shown and kept as the camera sends them. Two opt-ins restrict that: a privacy
hook (with_privacy) redacts every frame before any other stage
sees it, and cover_people covers every region the detector labels
person or face before a frame is shown or kept.
§Example
use std::sync::Arc;
use adk_surface::camera::{CameraFacts, Ingest, LiveCamera, LiveWatch, ZoneFacts};
use adk_vision::stream::{FrameBudget, SurfaceCameraSource};
use adk_vision::{FrameSourceId, GreedyIouTracker, WatchCondition};
let (source, _feed) = SurfaceCameraSource::new(FrameSourceId("line-2".into()));
let camera = LiveCamera::stream(
CameraFacts::new("line-2", "Line 2 camera", "inspector", "s-line")
.with_ingest(Ingest::rtsp(640, 360, "the line 2 server")),
Arc::new(source),
)
.tracker(|| Box::new(GreedyIouTracker::new(0.3, 4)))
.budget(FrameBudget::new(5.0).with_min_local_fps(1.0).with_local_quota(200_000))
.zone(ZoneFacts {
id: "inspection-window".into(),
name: "Inspection window".into(),
corners: [200.0, 140.0, 440.0, 280.0],
})
.watch(LiveWatch::new("crack", "Crack", WatchCondition::new("crack", ["crack"])).in_zone("inspection-window"));Implementations§
Source§impl LiveCamera
impl LiveCamera
Sourcepub fn stream(facts: CameraFacts, source: Arc<dyn FrameSource>) -> Self
pub fn stream(facts: CameraFacts, source: Arc<dyn FrameSource>) -> Self
A camera whose frames source reads: an RTSP camera, a file, a screen. It starts on
unless facts says otherwise.
Sourcepub fn surface(facts: CameraFacts) -> Self
pub fn surface(facts: CameraFacts) -> Self
The web home’s own camera (spec 3.7 §7.13 SurfaceCameraSource): frames the voice
screen or the camera page captures reach it through Cameras::ingest — the camera
page sends them to POST /surface/cameras/{camera}/frames — with no realtime model. It
starts off, says it comes “from the web home”, and takes nothing until a person
switches it on.
Sourcepub fn with_privacy(self, hook: Arc<dyn PrivacyHook>) -> Self
pub fn with_privacy(self, hook: Arc<dyn PrivacyHook>) -> Self
Passes every frame through hook before any other stage sees it, such as
RedactorPrivacy::blur_faces; a frame the hook fails on is dropped.
Sourcepub fn cover_people(self) -> Self
pub fn cover_people(self) -> Self
Covers every region the detector labels person or face, its whole box, before a
frame is shown or kept.
Sourcepub fn detector(self, runtime: Arc<VisionRuntime>, query: DetectQuery) -> Self
pub fn detector(self, runtime: Arc<VisionRuntime>, query: DetectQuery) -> Self
Detects query on every frame through runtime’s detection route.
Sourcepub fn detect_options(self, options: CallOptions) -> Self
pub fn detect_options(self, options: CallOptions) -> Self
The detection call’s options: a route, a region of interest.
Sourcepub fn tracker(
self,
make: impl Fn() -> Box<dyn Tracker> + Send + Sync + 'static,
) -> Self
pub fn tracker( self, make: impl Fn() -> Box<dyn Tracker> + Send + Sync + 'static, ) -> Self
Tracks detections across frames with a tracker make builds for each run of the
pipeline, so identifiers start again with each source session (V-I8).
Sourcepub fn budget(self, budget: FrameBudget) -> Self
pub fn budget(self, budget: FrameBudget) -> Self
Holds the camera to budget through a frame governor (spec 3.7 §7.9).
Sourcepub fn sampling(self, sampling: Sampling) -> Self
pub fn sampling(self, sampling: Sampling) -> Self
Samples the source at sampling; the budget’s local rate by default.
Sourcepub fn escalation(
self,
backend: impl Into<String>,
micros_per_frame: u64,
) -> Self
pub fn escalation( self, backend: impl Into<String>, micros_per_frame: u64, ) -> Self
Escalates unclear tracks to backend, such as sam-3.1, each billed frame costing
micros_per_frame micro-USD: PipelineCameras::escalate asks the governor first.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LiveCamera
impl !UnwindSafe for LiveCamera
impl Forget for LiveCamera
impl Freeze for LiveCamerawhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
NonZero<i32>: Freeze,
Utc: Freeze,
PhantomData<GovernorStep>: Freeze,
PhantomData<TrackFacts>: Freeze,
PhantomData<WatchFacts>: Freeze,
PhantomData<ZoneFacts>: Freeze,
*const ArcInner<dyn FrameSource> is !null: Freeze,
PhantomData<ArcInner<dyn FrameSource>>: Freeze,
*const ArcInner<SurfaceCameraSource> is !null: Freeze,
PhantomData<ArcInner<SurfaceCameraSource>>: Freeze,
*const ArcInner<Shared> is !null: Freeze,
PhantomData<ArcInner<Shared>>: Freeze,
*const ArcInner<dyn PrivacyHook> is !null: Freeze,
PhantomData<ArcInner<dyn PrivacyHook>>: Freeze,
*const ArcInner<VisionRuntime> is !null: Freeze,
PhantomData<ArcInner<VisionRuntime>>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Trigger>: Freeze,
PhantomData<Digest>: Freeze,
PhantomData<BBox>: Freeze,
*const ArcInner<dyn Fn() -> Box<dyn Tracker> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn() -> Box<dyn Tracker> + Sync + Send>>: Freeze,
PhantomData<LiveWatch>: Freeze,
impl Move for LiveCamera
impl Send for LiveCamera
impl Sync for LiveCamera
impl Unpin for LiveCamera
impl UnsafeUnpin for LiveCamerawhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
Utc: UnsafeUnpin,
PhantomData<GovernorStep>: UnsafeUnpin,
PhantomData<TrackFacts>: UnsafeUnpin,
PhantomData<WatchFacts>: UnsafeUnpin,
PhantomData<ZoneFacts>: UnsafeUnpin,
*const ArcInner<dyn FrameSource> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn FrameSource>>: UnsafeUnpin,
*const ArcInner<SurfaceCameraSource> is !null: UnsafeUnpin,
PhantomData<ArcInner<SurfaceCameraSource>>: UnsafeUnpin,
*const ArcInner<Shared> is !null: UnsafeUnpin,
PhantomData<ArcInner<Shared>>: UnsafeUnpin,
*const ArcInner<dyn PrivacyHook> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn PrivacyHook>>: UnsafeUnpin,
*const ArcInner<VisionRuntime> is !null: UnsafeUnpin,
PhantomData<ArcInner<VisionRuntime>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Trigger>: UnsafeUnpin,
PhantomData<Digest>: UnsafeUnpin,
PhantomData<BBox>: UnsafeUnpin,
*const ArcInner<dyn Fn() -> Box<dyn Tracker> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() -> Box<dyn Tracker> + Sync + Send>>: UnsafeUnpin,
PhantomData<LiveWatch>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more