qbcompiler.calibration.preprocess.GetImage Class Reference

qbcompiler.calibration.preprocess.GetImage Class Reference#

Mobilint SDK qb Compiler: qbcompiler.calibration.preprocess.GetImage Class Reference
Mobilint SDK qb Compiler v1.2
MCS002-EN
qbcompiler.calibration.preprocess.GetImage Class Reference

Retrieve an image tensor from a file path or NumPy array using OpenCV. More...

Public Member Functions

 __init__ (self, bool to_float32=False, str channel_order="bgr")
np.ndarray __call__ (self, Union[np.ndarray, str] img_input)
 Args: img_input (Union[np.ndarray, str]): Input image path or numpy tensor.
 get_image_data (self, str img_input)

Public Attributes

 to_float32 = to_float32
str channel_order = channel_order.lower()
 cvtColor = cvtColor
 COLOR_BGR2GRAY = COLOR_BGR2GRAY
 COLOR_BGRA2GRAY = COLOR_BGRA2GRAY
 COLOR_BGRA2BGR = COLOR_BGRA2BGR
 COLOR_BGR2RGB = COLOR_BGR2RGB
 COLOR_BGRA2RGB = COLOR_BGRA2RGB
 COLOR_BGRA2RGBA = COLOR_BGRA2RGBA
 COLOR_BGR2BGRA = COLOR_BGR2BGRA
 COLOR_BGR2RGBA = COLOR_BGR2RGBA
int num_channel = 1:

Detailed Description

Retrieve an image tensor from a file path or NumPy array using OpenCV.

Parameters
to_float32bool. Cast the output image to float32 when True. Defaults to False.
channel_orderstring. Channel order to enforce ("bgr", "rgb", "bw", "rgba", or "brga"). Defaults to "bgr".

Definition at line 146 of file preprocess.py.

Constructor & Destructor Documentation

◆ __init__()

qbcompiler.calibration.preprocess.GetImage.__init__ ( self,
bool to_float32 = False,
str channel_order = "bgr" )

Definition at line 154 of file preprocess.py.

Member Function Documentation

◆ __call__()

np.ndarray qbcompiler.calibration.preprocess.GetImage.__call__ ( self,
Union[np.ndarray, str] img_input )

Args: img_input (Union[np.ndarray, str]): Input image path or numpy tensor.

Returns: keepdims: Contains image numpy tensor and image meta such as "ori_shape".

Definition at line 175 of file preprocess.py.

◆ get_image_data()

qbcompiler.calibration.preprocess.GetImage.get_image_data ( self,
str img_input )

Definition at line 252 of file preprocess.py.

Member Data Documentation

◆ to_float32

qbcompiler.calibration.preprocess.GetImage.to_float32 = to_float32

Definition at line 156 of file preprocess.py.

◆ channel_order

str qbcompiler.calibration.preprocess.GetImage.channel_order = channel_order.lower()

Definition at line 158 of file preprocess.py.

◆ cvtColor

qbcompiler.calibration.preprocess.GetImage.cvtColor = cvtColor

Definition at line 165 of file preprocess.py.

◆ COLOR_BGR2GRAY

qbcompiler.calibration.preprocess.GetImage.COLOR_BGR2GRAY = COLOR_BGR2GRAY

Definition at line 166 of file preprocess.py.

◆ COLOR_BGRA2GRAY

qbcompiler.calibration.preprocess.GetImage.COLOR_BGRA2GRAY = COLOR_BGRA2GRAY

Definition at line 167 of file preprocess.py.

◆ COLOR_BGRA2BGR

qbcompiler.calibration.preprocess.GetImage.COLOR_BGRA2BGR = COLOR_BGRA2BGR

Definition at line 168 of file preprocess.py.

◆ COLOR_BGR2RGB

qbcompiler.calibration.preprocess.GetImage.COLOR_BGR2RGB = COLOR_BGR2RGB

Definition at line 169 of file preprocess.py.

◆ COLOR_BGRA2RGB

qbcompiler.calibration.preprocess.GetImage.COLOR_BGRA2RGB = COLOR_BGRA2RGB

Definition at line 170 of file preprocess.py.

◆ COLOR_BGRA2RGBA

qbcompiler.calibration.preprocess.GetImage.COLOR_BGRA2RGBA = COLOR_BGRA2RGBA

Definition at line 171 of file preprocess.py.

◆ COLOR_BGR2BGRA

qbcompiler.calibration.preprocess.GetImage.COLOR_BGR2BGRA = COLOR_BGR2BGRA

Definition at line 172 of file preprocess.py.

◆ COLOR_BGR2RGBA

qbcompiler.calibration.preprocess.GetImage.COLOR_BGR2RGBA = COLOR_BGR2RGBA

Definition at line 173 of file preprocess.py.

◆ num_channel

int qbcompiler.calibration.preprocess.GetImage.num_channel = 1:

Definition at line 186 of file preprocess.py.


The documentation for this class was generated from the following file: