pub struct Sample {Show 20 fields
pub id: Option<SampleID>,
pub group: Option<String>,
pub sequence_name: Option<String>,
pub sequence_uuid: Option<String>,
pub sequence_description: Option<String>,
pub frame_number: Option<u32>,
pub uuid: Option<String>,
pub image_name: Option<String>,
pub image_url: Option<String>,
pub width: Option<u32>,
pub height: Option<u32>,
pub date: Option<DateTime<Utc>>,
pub source: Option<String>,
pub location: Option<Location>,
pub degradation: Option<String>,
pub neg_label_indices: Option<Vec<u32>>,
pub not_exhaustive_label_indices: Option<Vec<u32>>,
pub files: Vec<SampleFile>,
pub annotations: Vec<Annotation>,
pub timing: Option<Timing>,
}Expand description
A sample in a dataset, typically representing a single image with metadata and optional sensor data.
Each sample has a unique ID, image reference, and can include additional sensor data like LiDAR, radar, or depth maps. Samples can also have associated annotations.
Fields§
§id: Option<SampleID>§group: Option<String>Dataset split (train, val, test) - stored in Arrow metadata, not used for directory structure. API field name discrepancy: samples.populate2 expects “group”, but samples.list returns “group_name”.
sequence_name: Option<String>§sequence_uuid: Option<String>§sequence_description: Option<String>§frame_number: Option<u32>§uuid: Option<String>§image_name: Option<String>§image_url: Option<String>§width: Option<u32>§height: Option<u32>§date: Option<DateTime<Utc>>§source: Option<String>§location: Option<Location>Camera location and pose (GPS + IMU data). Location data is extracted from the “sensors” field during deserialization. When uploading samples, this field is serialized as “sensors” to match the samples.populate2 API format.
degradation: Option<String>Image degradation type (blur, occlusion, weather, etc.).
neg_label_indices: Option<Vec<u32>>LVIS: label_index values for categories verified absent from this image.
not_exhaustive_label_indices: Option<Vec<u32>>LVIS: label_index values for categories with incomplete annotation.
files: Vec<SampleFile>Additional sensor files (LiDAR, radar, depth maps, etc.). Deserialization is handled by custom Deserialize impl which extracts files from the “sensors” field. Serialization converts to HashMap for samples.populate2 API.
annotations: Vec<Annotation>Annotations associated with this sample. Deserialization is handled by custom Deserialize impl.
timing: Option<Timing>Pipeline timing measurements (populated from Arrow, not from Studio JSON-RPC).
Implementations§
Source§impl Sample
impl Sample
pub fn id(&self) -> Option<SampleID>
pub fn name(&self) -> Option<String>
pub fn group(&self) -> Option<&String>
pub fn sequence_name(&self) -> Option<&String>
pub fn sequence_uuid(&self) -> Option<&String>
pub fn sequence_description(&self) -> Option<&String>
pub fn frame_number(&self) -> Option<u32>
pub fn uuid(&self) -> Option<&String>
pub fn image_name(&self) -> Option<&str>
pub fn image_url(&self) -> Option<&str>
pub fn width(&self) -> Option<u32>
pub fn height(&self) -> Option<u32>
pub fn date(&self) -> Option<DateTime<Utc>>
pub fn source(&self) -> Option<&String>
pub fn location(&self) -> Option<&Location>
pub fn files(&self) -> &[SampleFile]
pub fn annotations(&self) -> &[Annotation]
pub fn with_annotations(self, annotations: Vec<Annotation>) -> Self
pub fn with_frame_number(self, frame_number: Option<u32>) -> Self
Sourcepub async fn download(
&self,
client: &Client,
file_type: FileType,
) -> Result<Option<Vec<u8>>, Error>
pub async fn download( &self, client: &Client, file_type: FileType, ) -> Result<Option<Vec<u8>>, Error>
Downloads a file of the specified type for this sample.
Supports both newer datasets (pre-signed URLs) and legacy datasets (inline base64-encoded data):
- First tries to download from URL if available
- Falls back to decoding inline base64 data for legacy datasets
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sample
impl<'de> Deserialize<'de> for Sample
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Sample
impl RefUnwindSafe for Sample
impl Send for Sample
impl Sync for Sample
impl Unpin for Sample
impl UnsafeUnpin for Sample
impl UnwindSafe for Sample
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more