afe.apis.definesο
This file contains definitions of the types exposed by the development API for AFE.
Attributesο
Classesο
Generic enumeration. |
|
Color space standards for YUV and RGB conversion. |
|
Color conversion direction. |
|
Chroma sub-sampling representation. |
|
Interpolation method used in resize transform. |
|
Deposit location of resized image in padded frame. |
|
Quantization scheme. |
|
Parameters controlling how to quantize a network. |
Functionsο
|
|
|
Constructs quantization scheme. |
|
Constructs a bfloat16 quantization scheme. |
Module Contentsο
- afe.apis.defines.InputValuesο
- afe.apis.defines.gen1_targetο
- afe.apis.defines.gen2_targetο
- class afe.apis.defines.ExceptionFuncTypeο
Generic enumeration.
Derive from this class to define new enumerations.
- LOADED_NET_LOADο
- LOADED_NET_EXECUTEο
- LOADED_NET_QUANTIZEο
- LOADED_NET_CONVERTο
- MODEL_EXECUTEο
- MODEL_SAVEο
- MODEL_LOADο
- MODEL_COMPILEο
- MODEL_CREATE_AUXILIARYο
- MODEL_COMPOSEο
- MODEL_EVALUATEο
- MODEL_PERFORMANCEο
- GENERATE_ELF_FILESο
- QUANTIZATION_ERROR_ANALYSISο
- class afe.apis.defines.ColorSpaceStandardο
Color space standards for YUV and RGB conversion. BT601 is for SD video; BT709 is for HD video; BT2020 is for HDR.
- BT601 = 'BT601'ο
- BT709 = 'BT709'ο
- BT2020 = 'BT2020'ο
- afe.apis.defines.BT_COLOR_COEFF: Dict[ColorSpaceStandard, List[float]]ο
- afe.apis.defines.YUV2RGB_FULL_RANGE_CONSTANTS: Dict[str, List[float]]ο
- class afe.apis.defines.ColorConversionο
Color conversion direction.
- YUV2RGB = 'YUV2RGB'ο
- RGB2YUV = 'RGB2YUV'ο
- BGR2RGB = 'BGR2RGB'ο
- RGB2BGR = 'RGB2BGR'ο
- class afe.apis.defines.ChromaSamplingο
Chroma sub-sampling representation.
- NV12 = 'NV12'ο
- YUV420 = 'YUV420'ο
- YUV422 = 'YUV422'ο
- class afe.apis.defines.ResizeMethodο
Interpolation method used in resize transform.
- LINEAR = 'linear'ο
- NEAREST = 'nearest'ο
- AREA = 'area'ο
- CUBIC = 'cubic'ο
- class afe.apis.defines.ResizeDepositLocationο
Deposit location of resized image in padded frame.
- TOPLEFT = 'topleft'ο
- CENTER = 'center'ο
- BOTTOMRIGHT = 'bottomright'ο
- class afe.apis.defines.MinMaxMethodο
- class afe.apis.defines.MovingAverageMinMaxMethodο
- class afe.apis.defines.HistogramPercentileMethod(percentile_value, num_bins)ο
- percentile_value: floatο
- num_bins: intο
- afe.apis.defines.default_calibration() CalibrationMethod ο
- class afe.apis.defines.QuantizationSchemeο
Quantization scheme.
- Parameters:
asymmetric β Whether to use asymmetric quantization.
per_channel β Whether to use per-channel quantization.
bits β Number of bits of precision to use in the quantized representation
bf16 β Whether to use bfloat16. If True, then asymmetric, per_channel, and bits are ignored.
- asymmetric: boolο
- per_channel: boolο
- bits: int = 8ο
- bf16: bool = Falseο
- afe.apis.defines.quantization_scheme(asymmetric: bool, per_channel: bool, bits: int = 8) QuantizationScheme ο
Constructs quantization scheme.
- afe.apis.defines.bfloat16_scheme() QuantizationScheme ο
Constructs a bfloat16 quantization scheme. It directs the compiler to use bfloat16 instead of integer quantization.
- class afe.apis.defines.QuantizationParamsο
Parameters controlling how to quantize a network.
- Parameters:
calibration_method β Calibration method.
activation_quantization_scheme β Quantization scheme for activation tensors.
weight_quantization_scheme β Quantization scheme for weights tensors.
requantization_mode β A way of doing quantized arithmetic.
node_names β Nodes to prevent from quantizing.
custom_quantization_configs β Dictionary setting the nodeβs custom quantization options.
biascorr_type β Selection of bias correction: regular/iterative/none
channel_equalization β If True, channel equalization is enabled.
smooth_quant β If True, smooth quant is enabled.
- calibration_method: CalibrationMethodο
- activation_quantization_scheme: QuantizationSchemeο
- weight_quantization_scheme: QuantizationSchemeο
- requantization_mode: afe.ir.defines.RequantizationModeο
- node_names: Set[str]ο
- custom_quantization_configs: Dict[afe.ir.defines.NodeName, Dict[str, Any]] | None = Noneο
- biascorr_type: afe.ir.defines.BiasCorrectionTypeο
- channel_equalization: bool = Falseο
- smooth_quant: bool = Falseο
- with_calibration(method: CalibrationMethod) QuantizationParams ο
- with_activation_quantization(scheme: QuantizationScheme) QuantizationParams ο
- with_weight_quantization(scheme: QuantizationScheme) QuantizationParams ο
- with_requantization_mode(requantization_mode: afe.ir.defines.RequantizationMode)ο
- with_unquantized_nodes(node_names: Set[str]) QuantizationParams ο
- with_custom_quantization_configs(custom_quantization_configs: Dict[afe.ir.defines.NodeName, Dict[str, Any]])ο
- with_bias_correction(enable: bool | afe.ir.defines.BiasCorrectionType = True)ο
- with_channel_equalization(enable: bool = True)ο
- with_smooth_quant(enable: bool = True)ο
- afe.apis.defines.default_quantization: QuantizationParamsο
- afe.apis.defines.int16_quantization: QuantizationParamsο