ImageAugmentation

Trait ImageAugmentation 

Source
pub trait ImageAugmentation: Send + Sync {
    // Required methods
    fn augment_batch(
        &self,
        images: &[f32],
        batch_size: usize,
        channels: usize,
        height: usize,
        width: usize,
        seed: u64,
    ) -> Result<Vec<f32>, RloxError>;
    fn name(&self) -> &str;
}
Expand description

Trait for composable image augmentations.

Implementors transform a flat batch of images (B, C, H, W) stored as contiguous f32 arrays. The trait enables adding new augmentations (color jitter, cutout, etc.) without modifying existing code.

Required Methods§

Source

fn augment_batch( &self, images: &[f32], batch_size: usize, channels: usize, height: usize, width: usize, seed: u64, ) -> Result<Vec<f32>, RloxError>

Apply the augmentation to a batch of images.

images is a flat array of length batch_size * channels * height * width. Returns a new flat array of the same length.

Source

fn name(&self) -> &str

Human-readable name for logging/debugging.

Implementors§