pub struct ModelInputSpec {
pub image_size: (usize, usize),
pub channels: usize,
pub normalization: NormalizationSpec,
pub preprocessing: Vec<String>,
pub tensor_format: TensorFormat,
pub data_type: ModelDataType,
pub value_range: (f32, f32),
}Expand description
Model input specification for computer vision models
Fields§
§image_size: (usize, usize)Expected input image size (width, height)
channels: usizeNumber of input channels
normalization: NormalizationSpecNormalization parameters
preprocessing: Vec<String>Required preprocessing steps
tensor_format: TensorFormatInput tensor format (NCHW, NHWC, etc.)
data_type: ModelDataTypeData type requirements
value_range: (f32, f32)Input value range
Implementations§
Source§impl ModelInputSpec
impl ModelInputSpec
Sourcepub fn classification(image_size: (usize, usize)) -> Self
pub fn classification(image_size: (usize, usize)) -> Self
Create specification for classification models
Sourcepub fn object_detection(image_size: (usize, usize)) -> Self
pub fn object_detection(image_size: (usize, usize)) -> Self
Create specification for object detection models
Sourcepub fn segmentation(image_size: (usize, usize)) -> Self
pub fn segmentation(image_size: (usize, usize)) -> Self
Create specification for segmentation models
Sourcepub fn validate(&self) -> Result<(), ModelError>
pub fn validate(&self) -> Result<(), ModelError>
Validate input specification
Sourcepub fn memory_requirements(&self, batch_size: usize) -> usize
pub fn memory_requirements(&self, batch_size: usize) -> usize
Calculate memory requirements for input
Trait Implementations§
Source§impl Clone for ModelInputSpec
impl Clone for ModelInputSpec
Source§fn clone(&self) -> ModelInputSpec
fn clone(&self) -> ModelInputSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelInputSpec
impl Debug for ModelInputSpec
Source§impl Default for ModelInputSpec
impl Default for ModelInputSpec
Source§impl<'de> Deserialize<'de> for ModelInputSpec
impl<'de> Deserialize<'de> for ModelInputSpec
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModelInputSpec
impl RefUnwindSafe for ModelInputSpec
impl Send for ModelInputSpec
impl Sync for ModelInputSpec
impl Unpin for ModelInputSpec
impl UnwindSafe for ModelInputSpec
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more