Skip to main content

Engine

Struct Engine 

Source
pub struct Engine { /* private fields */ }

Implementations§

Source§

impl Engine

Source

pub fn new() -> Self

Examples found in repository?
examples/basic_usage.rs (line 22)
21fn main() {
22    let mut engine = Engine::new();
23
24    // Two sightings of the same chair, 0.5s apart, fuse into one
25    // MapObject instead of piling up as two separate detections.
26    engine.ingest_frame(chair_frame(0.0));
27    let scene_map = engine.ingest_frame(chair_frame(0.5));
28
29    let chair = &scene_map.objects[0];
30    println!(
31        "fused '{}' at ({:.2}, {:.2}), confidence {:.2} from {} observation(s)",
32        chair.label, chair.x, chair.y, chair.confidence, chair.observation_count
33    );
34    println!("\nfull SceneMap as GeoJSON:\n{}", scene_map.to_geojson_json().unwrap());
35}
Source

pub fn with_config(config: EngineConfig) -> Self

Source

pub fn ingest_frame(&mut self, frame: Frame) -> &SceneMap

Examples found in repository?
examples/basic_usage.rs (line 26)
21fn main() {
22    let mut engine = Engine::new();
23
24    // Two sightings of the same chair, 0.5s apart, fuse into one
25    // MapObject instead of piling up as two separate detections.
26    engine.ingest_frame(chair_frame(0.0));
27    let scene_map = engine.ingest_frame(chair_frame(0.5));
28
29    let chair = &scene_map.objects[0];
30    println!(
31        "fused '{}' at ({:.2}, {:.2}), confidence {:.2} from {} observation(s)",
32        chair.label, chair.x, chair.y, chair.confidence, chair.observation_count
33    );
34    println!("\nfull SceneMap as GeoJSON:\n{}", scene_map.to_geojson_json().unwrap());
35}

Trait Implementations§

Source§

impl Default for Engine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.