samples_dataframe

Function samples_dataframe 

Source
pub fn samples_dataframe(samples: &[Sample]) -> Result<DataFrame, Error>
Expand description

Create a DataFrame from a slice of samples with complete 2025.10 schema.

This function generates a DataFrame with all 13 columns including optional sample metadata (size, location, pose, degradation). Each annotation in each sample becomes one row in the DataFrame.

§Schema (2025.10)

  • name: Sample name (String)
  • frame: Frame number (UInt64)
  • object_id: Object tracking ID (String)
  • label: Object label (Categorical)
  • label_index: Label index (UInt64)
  • group: Dataset group (Categorical)
  • mask: Segmentation mask (List)
  • box2d: 2D bounding box [cx, cy, w, h] (Array<Float32, 4>)
  • box3d: 3D bounding box [x, y, z, w, h, l] (Array<Float32, 6>)
  • size: Image size [width, height] (Array<UInt32, 2>) - OPTIONAL
  • location: GPS [lat, lon] (Array<Float32, 2>) - OPTIONAL
  • pose: IMU [yaw, pitch, roll] (Array<Float32, 3>) - OPTIONAL
  • degradation: Image degradation (String) - OPTIONAL

§Example

use edgefirst_client::{Client, samples_dataframe};

let samples = client
    .samples(dataset_id, Some(annotation_set_id), &[], &[], &[], None)
    .await?;
let df = samples_dataframe(&samples)?;
println!("DataFrame shape: {:?}", df.shape());