Struct caffe2_image::ImageInputOp
source · pub struct ImageInputOp<Context> { /* private fields */ }
Expand description
| Imports and processes images from a | database. For each run of the operator, | batch_size images will be processed. | GPUs can optionally be used for part | of the processing. | | The following transformations are | applied to the image | | - A bounding box is applied to the initial | image (optional) | | - The image is rescaled either up or down | (with the scale argument) or just up | (with the minsize argument) | | - The image is randomly cropped (crop | size is passed as an argument but the | location of the crop is random except | if is_test is passed in which case the | image in cropped at the center) | | - The image is normalized. Each of its | color channels can have separate normalization | values | | The dimension of the output image will | always be cropxcrop |
Implementations§
source§impl<Context> ImageInputOp<Context>
impl<Context> ImageInputOp<Context>
pub fn new(operator_def: &OperatorDef, ws: *mut Workspace) -> Self
pub fn get_image_and_label_and_info_from_dbvalue( &mut self, value: &String, img: *mut Mat, info: &mut PerImageArg, item_id: i32, randgen: *mut MT19937 ) -> bool
sourcepub fn saturation(
&mut self,
img: *mut f32,
img_size: i32,
alpha_rand: f32,
randgen: *mut MT19937
)
pub fn saturation( &mut self, img: *mut f32, img_size: i32, alpha_rand: f32, randgen: *mut MT19937 )
assume HWC order and color channels BGR
sourcepub fn brightness(
&mut self,
img: *mut f32,
img_size: i32,
alpha_rand: f32,
randgen: *mut MT19937
)
pub fn brightness( &mut self, img: *mut f32, img_size: i32, alpha_rand: f32, randgen: *mut MT19937 )
assume HWC order and color channels BGR
sourcepub fn contrast(
&mut self,
img: *mut f32,
img_size: i32,
alpha_rand: f32,
randgen: *mut MT19937
)
pub fn contrast( &mut self, img: *mut f32, img_size: i32, alpha_rand: f32, randgen: *mut MT19937 )
assume HWC order and color channels BGR
sourcepub fn color_jitter(
&mut self,
img: *mut f32,
img_size: i32,
saturation: f32,
brightness: f32,
contrast: f32,
randgen: *mut MT19937
)
pub fn color_jitter( &mut self, img: *mut f32, img_size: i32, saturation: f32, brightness: f32, contrast: f32, randgen: *mut MT19937 )
assume HWC order and color channels BGR
sourcepub fn color_lighting(
&mut self,
img: *mut f32,
img_size: i32,
alpha_std: f32,
eigvecs: &Vec<Vec<f32>>,
eigvals: &Vec<f32>,
randgen: *mut MT19937
)
pub fn color_lighting( &mut self, img: *mut f32, img_size: i32, alpha_std: f32, eigvecs: &Vec<Vec<f32>>, eigvals: &Vec<f32>, randgen: *mut MT19937 )
assume HWC order and color channels BGR
sourcepub fn color_normalization(
&mut self,
img: *mut f32,
img_size: i32,
channels: i32,
mean: &Vec<f32>,
std: &Vec<f32>
)
pub fn color_normalization( &mut self, img: *mut f32, img_size: i32, channels: i32, mean: &Vec<f32>, std: &Vec<f32> )
| assume HWC order and color channels | BGR mean subtraction and scaling. |
sourcepub fn decode_and_transform(
&mut self,
value: &mut String,
image_data: *mut f32,
item_id: i32,
channels: i32,
thread_index: usize
)
pub fn decode_and_transform( &mut self, value: &mut String, image_data: *mut f32, item_id: i32, channels: i32, thread_index: usize )
| Parse datum, decode image, perform | transform | | Intended as entry point for binding | to thread pool |
pub fn decode_and_transpose_only( &mut self, value: &String, image_data: *mut u8, item_id: i32, channels: i32, thread_index: usize )
pub fn prefetch(&mut self) -> bool
pub fn copy_prefetched(&mut self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<Context> !RefUnwindSafe for ImageInputOp<Context>
impl<Context> !Send for ImageInputOp<Context>
impl<Context> !Sync for ImageInputOp<Context>
impl<Context> Unpin for ImageInputOp<Context>where Context: Unpin,
impl<Context> !UnwindSafe for ImageInputOp<Context>
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.