pub struct WithDataset<'a, T> { /* private fields */ }
Expand description

A wrapper struct that wraps around a base type with a reference to dataset.

Implementations§

source§

impl<'a> WithDataset<'a, CalibratedSensor>

source

pub fn sensor(&self) -> WithDataset<'a, Sensor>

source§

impl<'a> WithDataset<'a, InstanceInternal>

source§

impl<'a> WithDataset<'a, Log>

source

pub fn open(&self) -> IoResult<Option<File>>

source§

impl<'a> WithDataset<'a, Map>

source

pub fn log_iter(&self) -> Iter<'a, Log, SliceIter<'a, LongToken>>

source§

impl<'a> WithDataset<'a, SampleInternal>

source

pub fn sample_annotation_iter( &self ) -> Iter<'a, SampleAnnotation, SliceIter<'a, LongToken>>

Examples found in repository?
examples/main.rs (line 29)
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
fn main() -> NuScenesDataResult<()> {
    // Change the path to your dataset directory
    let dataset = NuScenesDataset::load("1.02", "/some/path/v1.02-train")?;

    // Iterate over scenes chronologically
    for scene in dataset.scene_iter() {
        println!("read scene {}", scene.token);

        // Get associated log
        let log = scene.log();
        println!("captured at {}", log.date_captured);

        // Iterate over associated samples
        for sample in scene.sample_iter() {
            println!(
                "found sample {} in scene {} with timestamp {}",
                sample.token, scene.token, sample.timestamp
            );

            // Get the related scene back from sample
            assert_eq!(scene.token, sample.scene_token);
            assert_eq!(scene.token, sample.scene().token);

            // Iterate over associated annotations
            for annotation in sample.sample_annotation_iter() {
                println!(
                    "found annotation {} in sample {}",
                    annotation.token, sample.token,
                );
            }

            // Iterate over associated data
            for data in sample.sample_data_iter() {
                println!("found data {} in sample {}", data.token, sample.token);

                // Load data
                match data.load()? {
                    LoadedSampleData::PointCloud(matrix) => {
                        println!(
                            "get point cloud from data {} with {} points",
                            data.token,
                            matrix.nrows()
                        );
                    }
                    LoadedSampleData::Image(image) => {
                        println!(
                            "get image from data {} with shape {}x{}",
                            data.token,
                            image.width(),
                            image.height()
                        );
                    }
                }
            }
        }
    }

    Ok(())
}
source

pub fn sample_data_iter(&self) -> Iter<'a, SampleData, SliceIter<'a, LongToken>>

Examples found in repository?
examples/main.rs (line 37)
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
fn main() -> NuScenesDataResult<()> {
    // Change the path to your dataset directory
    let dataset = NuScenesDataset::load("1.02", "/some/path/v1.02-train")?;

    // Iterate over scenes chronologically
    for scene in dataset.scene_iter() {
        println!("read scene {}", scene.token);

        // Get associated log
        let log = scene.log();
        println!("captured at {}", log.date_captured);

        // Iterate over associated samples
        for sample in scene.sample_iter() {
            println!(
                "found sample {} in scene {} with timestamp {}",
                sample.token, scene.token, sample.timestamp
            );

            // Get the related scene back from sample
            assert_eq!(scene.token, sample.scene_token);
            assert_eq!(scene.token, sample.scene().token);

            // Iterate over associated annotations
            for annotation in sample.sample_annotation_iter() {
                println!(
                    "found annotation {} in sample {}",
                    annotation.token, sample.token,
                );
            }

            // Iterate over associated data
            for data in sample.sample_data_iter() {
                println!("found data {} in sample {}", data.token, sample.token);

                // Load data
                match data.load()? {
                    LoadedSampleData::PointCloud(matrix) => {
                        println!(
                            "get point cloud from data {} with {} points",
                            data.token,
                            matrix.nrows()
                        );
                    }
                    LoadedSampleData::Image(image) => {
                        println!(
                            "get image from data {} with shape {}x{}",
                            data.token,
                            image.width(),
                            image.height()
                        );
                    }
                }
            }
        }
    }

    Ok(())
}
source

pub fn scene(&self) -> WithDataset<'a, SceneInternal>

Examples found in repository?
examples/main.rs (line 26)
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
fn main() -> NuScenesDataResult<()> {
    // Change the path to your dataset directory
    let dataset = NuScenesDataset::load("1.02", "/some/path/v1.02-train")?;

    // Iterate over scenes chronologically
    for scene in dataset.scene_iter() {
        println!("read scene {}", scene.token);

        // Get associated log
        let log = scene.log();
        println!("captured at {}", log.date_captured);

        // Iterate over associated samples
        for sample in scene.sample_iter() {
            println!(
                "found sample {} in scene {} with timestamp {}",
                sample.token, scene.token, sample.timestamp
            );

            // Get the related scene back from sample
            assert_eq!(scene.token, sample.scene_token);
            assert_eq!(scene.token, sample.scene().token);

            // Iterate over associated annotations
            for annotation in sample.sample_annotation_iter() {
                println!(
                    "found annotation {} in sample {}",
                    annotation.token, sample.token,
                );
            }

            // Iterate over associated data
            for data in sample.sample_data_iter() {
                println!("found data {} in sample {}", data.token, sample.token);

                // Load data
                match data.load()? {
                    LoadedSampleData::PointCloud(matrix) => {
                        println!(
                            "get point cloud from data {} with {} points",
                            data.token,
                            matrix.nrows()
                        );
                    }
                    LoadedSampleData::Image(image) => {
                        println!(
                            "get image from data {} with shape {}x{}",
                            data.token,
                            image.width(),
                            image.height()
                        );
                    }
                }
            }
        }
    }

    Ok(())
}
source

pub fn prev(&self) -> Option<WithDataset<'a, SampleInternal>>

source

pub fn next(&self) -> Option<WithDataset<'a, SampleInternal>>

source§

impl<'a> WithDataset<'a, SampleAnnotation>

source§

impl<'a> WithDataset<'a, SampleData>

source

pub fn open(&self) -> IoResult<File>

source

pub fn load_raw(&self) -> NuScenesDataResult<Vec<u8>>

source

pub fn load(&self) -> NuScenesDataResult<LoadedSampleData>

Examples found in repository?
examples/main.rs (line 41)
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
fn main() -> NuScenesDataResult<()> {
    // Change the path to your dataset directory
    let dataset = NuScenesDataset::load("1.02", "/some/path/v1.02-train")?;

    // Iterate over scenes chronologically
    for scene in dataset.scene_iter() {
        println!("read scene {}", scene.token);

        // Get associated log
        let log = scene.log();
        println!("captured at {}", log.date_captured);

        // Iterate over associated samples
        for sample in scene.sample_iter() {
            println!(
                "found sample {} in scene {} with timestamp {}",
                sample.token, scene.token, sample.timestamp
            );

            // Get the related scene back from sample
            assert_eq!(scene.token, sample.scene_token);
            assert_eq!(scene.token, sample.scene().token);

            // Iterate over associated annotations
            for annotation in sample.sample_annotation_iter() {
                println!(
                    "found annotation {} in sample {}",
                    annotation.token, sample.token,
                );
            }

            // Iterate over associated data
            for data in sample.sample_data_iter() {
                println!("found data {} in sample {}", data.token, sample.token);

                // Load data
                match data.load()? {
                    LoadedSampleData::PointCloud(matrix) => {
                        println!(
                            "get point cloud from data {} with {} points",
                            data.token,
                            matrix.nrows()
                        );
                    }
                    LoadedSampleData::Image(image) => {
                        println!(
                            "get image from data {} with shape {}x{}",
                            data.token,
                            image.width(),
                            image.height()
                        );
                    }
                }
            }
        }
    }

    Ok(())
}
source

pub fn sample(&self) -> WithDataset<'a, SampleInternal>

source

pub fn ego_pose(&self) -> WithDataset<'a, EgoPose>

source

pub fn calibrated_sensor(&self) -> WithDataset<'a, CalibratedSensor>

source

pub fn prev(&self) -> Option<WithDataset<'a, SampleData>>

source

pub fn next(&self) -> Option<WithDataset<'a, SampleData>>

source§

impl<'a> WithDataset<'a, SceneInternal>

source

pub fn log(&self) -> WithDataset<'a, Log>

Examples found in repository?
examples/main.rs (line 14)
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
fn main() -> NuScenesDataResult<()> {
    // Change the path to your dataset directory
    let dataset = NuScenesDataset::load("1.02", "/some/path/v1.02-train")?;

    // Iterate over scenes chronologically
    for scene in dataset.scene_iter() {
        println!("read scene {}", scene.token);

        // Get associated log
        let log = scene.log();
        println!("captured at {}", log.date_captured);

        // Iterate over associated samples
        for sample in scene.sample_iter() {
            println!(
                "found sample {} in scene {} with timestamp {}",
                sample.token, scene.token, sample.timestamp
            );

            // Get the related scene back from sample
            assert_eq!(scene.token, sample.scene_token);
            assert_eq!(scene.token, sample.scene().token);

            // Iterate over associated annotations
            for annotation in sample.sample_annotation_iter() {
                println!(
                    "found annotation {} in sample {}",
                    annotation.token, sample.token,
                );
            }

            // Iterate over associated data
            for data in sample.sample_data_iter() {
                println!("found data {} in sample {}", data.token, sample.token);

                // Load data
                match data.load()? {
                    LoadedSampleData::PointCloud(matrix) => {
                        println!(
                            "get point cloud from data {} with {} points",
                            data.token,
                            matrix.nrows()
                        );
                    }
                    LoadedSampleData::Image(image) => {
                        println!(
                            "get image from data {} with shape {}x{}",
                            data.token,
                            image.width(),
                            image.height()
                        );
                    }
                }
            }
        }
    }

    Ok(())
}
source

pub fn sample_iter(&self) -> Iter<'a, SampleInternal, SliceIter<'a, LongToken>>

Examples found in repository?
examples/main.rs (line 18)
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
fn main() -> NuScenesDataResult<()> {
    // Change the path to your dataset directory
    let dataset = NuScenesDataset::load("1.02", "/some/path/v1.02-train")?;

    // Iterate over scenes chronologically
    for scene in dataset.scene_iter() {
        println!("read scene {}", scene.token);

        // Get associated log
        let log = scene.log();
        println!("captured at {}", log.date_captured);

        // Iterate over associated samples
        for sample in scene.sample_iter() {
            println!(
                "found sample {} in scene {} with timestamp {}",
                sample.token, scene.token, sample.timestamp
            );

            // Get the related scene back from sample
            assert_eq!(scene.token, sample.scene_token);
            assert_eq!(scene.token, sample.scene().token);

            // Iterate over associated annotations
            for annotation in sample.sample_annotation_iter() {
                println!(
                    "found annotation {} in sample {}",
                    annotation.token, sample.token,
                );
            }

            // Iterate over associated data
            for data in sample.sample_data_iter() {
                println!("found data {} in sample {}", data.token, sample.token);

                // Load data
                match data.load()? {
                    LoadedSampleData::PointCloud(matrix) => {
                        println!(
                            "get point cloud from data {} with {} points",
                            data.token,
                            matrix.nrows()
                        );
                    }
                    LoadedSampleData::Image(image) => {
                        println!(
                            "get image from data {} with shape {}x{}",
                            data.token,
                            image.width(),
                            image.height()
                        );
                    }
                }
            }
        }
    }

    Ok(())
}

Trait Implementations§

source§

impl<'a, T: Clone> Clone for WithDataset<'a, T>

source§

fn clone(&self) -> WithDataset<'a, T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, T: Debug> Debug for WithDataset<'a, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T> Deref for WithDataset<'a, T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for WithDataset<'a, T>where T: RefUnwindSafe,

§

impl<'a, T> Send for WithDataset<'a, T>where T: Sync,

§

impl<'a, T> Sync for WithDataset<'a, T>where T: Sync,

§

impl<'a, T> Unpin for WithDataset<'a, T>

§

impl<'a, T> UnwindSafe for WithDataset<'a, T>where T: RefUnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.