Skip to content

Inference Option

Inference option,,,.

Classes

Type Name
struct SaigeTextFormatting
(OCR) Option for specifying the format of text to be recognized. There are two approaches: setting a character set for recognition regardless of character count, or defining character sets based on character position.
struct SaigeInferenceOption
inference options struct

Public Functions

Type Name
int SaigeSetInferenceOption (SaigeInferenceHandle handle, SaigeInferenceOption * option, const unsigned int flags)
Sets inference option values on the inference handle.
int SaigeGetInferenceOption (SaigeInferenceHandle handle, SaigeInferenceOption * option)
Retrieves inference option values from the inference handle.

Macros

Type Name
define SAIGE_WRITE_ON_MODEL_FILE 0x01
(Common) When setting inference option values using SaigeSetInferenceOption, this flag saves the option values to the model file as well.
define SAIGE_SET_CALC_TIME 0x2
(Common) Flag to set the calcTime option.
define SAIGE_SET_OVERSIZED_IMAGE_HANDLING 0x4
(SEG, OCR, IEN) Flag to set the oversizedImageHandling option.
define SAIGE_SET_ADDITIONAL_SCORES 0x8
(CLS) Flag to set the additionalScores option.
define SAIGE_SET_CALC_CLASS_ACTIVATION_MAP 0x10
(CLS) Flag to set the calcClassActivationMap option.
define SAIGE_SET_MAX_NUM_OF_DETECTED_OBJECTS 0x20
(DET) Flag to set the maxNumOfDetectedObjects option.
define SAIGE_SET_CALC_SCOREMAP 0x40
(SEG) Flag to set the calcScoremap option.
define SAIGE_SET_CALC_OBJECT 0x80
(SEG, IAD) Flag to set the calcObject option.
define SAIGE_SET_CALC_OBJECT_AREA_AND_APPLY_THRESHOLD 0x100
(SEG, IAD) Flag to set the calcObjectAreaAndApplyThreshold option.
define SAIGE_SET_CALC_OBJECT_SCORE_AND_APPLY_THRESHOLD 0x200
(SEG, IAD) Flag to set the calcObjectScoreAndApplyThreshold option.
define SAIGE_SET_OBJECT_BOUNDARY_THRESHOLD 0x400
(SEG, IAD) Flag to set objectBoundaryThresholdPerClass in SEG and objectBoundaryThreshold in IAD.
define SAIGE_SET_OBJECT_AREA_THRESHOLD 0x800
(SEG, DET, IAD) Flag to set objectAreaThresholdPerClass in SEG and DET, and objectAreaThreshold in IAD.
define SAIGE_SET_OBJECT_SCORE_THRESHOLD 0x1000
(SEG, DET, IAD) Flag to set objectScoreThresholdPerClass in SEG and DET, and objectScoreThreshold in IAD.
define SAIGE_SET_CALC_MASK 0x2000
(SEG, IAD) Flag to set the calcMask option.
define SAIGE_SET_CALC_HEATMAP 0x4000
(IAD) Flag to set the calcHeatmap option.
define SAIGE_SET_ANOMALY_SCORE_THRESHOLD 0x8000
(IAD) Flag to set the anomalyScoreThreshold option.
define SAIGE_SET_HEATMAP_COLOR_RANGE 0x10000
(IAD) Flag to set heatmapColorRangeMin and heatmapColorRangeMax options.
define SAIGE_SET_POLYGON_SCORE_THRESHOLD 0x20000
(OCR) Flag to set the polygonScoreThreshold option.
define SAIGE_SET_TEXT_SIZE_RANGE 0x40000
(OCR) Flag to set textSizeRangeMin and textSizeRangeMax options.
define SAIGE_SET_NUM_OF_TEXT_OBJECTS 0x80000
(OCR) Flag to set the maxNumOfTextObjects option.
define SAIGE_SET_TEXT_SCORE_THRESHOLD 0x100000
(OCR) Flag to set the textScoreThreshold option.
define SAIGE_SET_TEXT_FORMATTING 0x200000
(OCR) Flag to set the textFormatting option.
define SAIGE_DO_NOT_INSPECT "do_not_inspect"
(SEG) An option for oversizedImageHandling, where inference is not performed and an error is raised.
define SAIGE_DO_NOT_ENHANCE "do_not_enhance"
(IEN) An option for oversizedImageHandling, where inference is not performed and an error is raised.
define SAIGE_RESIZE_TO_FIT "resize_to_fit"
(SEG) An option for oversizedImageHandling. When set, the image is resized to fit within the inspection size, maintaining its aspect ratio, and then inference is performed.
define SAIGE_CROP_INTO_TILES "crop_into_tiles"
(SEG, IEN) An option for oversizedImageHandling. When set, the image is cropped into tiles based on the inspection size. Inference is performed on each tile, and results are combined.

Public Functions Documentation

SaigeSetInferenceOption

Sets inference option values on the inference handle.

int SaigeSetInferenceOption (
    SaigeInferenceHandle handle,
    SaigeInferenceOption * option,
    const unsigned int flags
) 

Parameters:

  • handle The inference handle to use.
  • option The structure containing the option values to set.
  • flags The specific option items to set.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

See also: SaigeInferenceOption

SaigeGetInferenceOption

Retrieves inference option values from the inference handle.

int SaigeGetInferenceOption (
    SaigeInferenceHandle handle,
    SaigeInferenceOption * option
) 

Parameters:

  • handle The inference handle from which to retrieve option values.
  • option [out] The structure to hold the retrieved option values.

Returns:

errorCode Returns 0 on success, or an error code if there is a failure.

See also: SaigeInferenceOption

Macro Definition Documentation

SAIGE_WRITE_ON_MODEL_FILE

(Common) When setting inference option values using SaigeSetInferenceOption, this flag saves the option values to the model file as well.

#define SAIGE_WRITE_ON_MODEL_FILE 0x01

SAIGE_SET_CALC_TIME

(Common) Flag to set the calcTime option.

#define SAIGE_SET_CALC_TIME 0x2

See also: SaigeInferenceOption::calcTime

SAIGE_SET_OVERSIZED_IMAGE_HANDLING

(SEG, OCR, IEN) Flag to set the oversizedImageHandling option.

#define SAIGE_SET_OVERSIZED_IMAGE_HANDLING 0x4

See also: SaigeInferenceOption::oversizedImageHandling

SAIGE_SET_ADDITIONAL_SCORES

(CLS) Flag to set the additionalScores option.

#define SAIGE_SET_ADDITIONAL_SCORES 0x8

See also: SaigeInferenceOption::additionalScores

SAIGE_SET_CALC_CLASS_ACTIVATION_MAP

(CLS) Flag to set the calcClassActivationMap option.

#define SAIGE_SET_CALC_CLASS_ACTIVATION_MAP 0x10

See also: SaigeInferenceOption::calcClassActivationMap

SAIGE_SET_MAX_NUM_OF_DETECTED_OBJECTS

(DET) Flag to set the maxNumOfDetectedObjects option.

#define SAIGE_SET_MAX_NUM_OF_DETECTED_OBJECTS 0x20

SAIGE_SET_CALC_SCOREMAP

(SEG) Flag to set the calcScoremap option.

#define SAIGE_SET_CALC_SCOREMAP 0x40

See also: SaigeInferenceOption::calcScoremap

SAIGE_SET_CALC_OBJECT

(SEG, IAD) Flag to set the calcObject option.

#define SAIGE_SET_CALC_OBJECT 0x80

See also: SaigeInferenceOption::calcObject

SAIGE_SET_CALC_OBJECT_AREA_AND_APPLY_THRESHOLD

(SEG, IAD) Flag to set the calcObjectAreaAndApplyThreshold option.

#define SAIGE_SET_CALC_OBJECT_AREA_AND_APPLY_THRESHOLD 0x100

See also: SaigeInferenceOption::calcObjectAreaAndApplyThreshold

SAIGE_SET_CALC_OBJECT_SCORE_AND_APPLY_THRESHOLD

(SEG, IAD) Flag to set the calcObjectScoreAndApplyThreshold option.

#define SAIGE_SET_CALC_OBJECT_SCORE_AND_APPLY_THRESHOLD 0x200

See also: SaigeInferenceOption::calcObjectScoreAndApplyThreshold

SAIGE_SET_OBJECT_BOUNDARY_THRESHOLD

(SEG, IAD) Flag to set objectBoundaryThresholdPerClass in SEG and objectBoundaryThreshold in IAD.

#define SAIGE_SET_OBJECT_BOUNDARY_THRESHOLD 0x400

See also: SaigeInferenceOption::objectBoundaryThresholdPerClass, SaigeInferenceOption::objectBoundaryThreshold

SAIGE_SET_OBJECT_AREA_THRESHOLD

(SEG, DET, IAD) Flag to set objectAreaThresholdPerClass in SEG and DET, and objectAreaThreshold in IAD.

#define SAIGE_SET_OBJECT_AREA_THRESHOLD 0x800

See also: SaigeInferenceOption::objectAreaThresholdPerClass, SaigeInferenceOption::objectAreaThreshold

SAIGE_SET_OBJECT_SCORE_THRESHOLD

(SEG, DET, IAD) Flag to set objectScoreThresholdPerClass in SEG and DET, and objectScoreThreshold in IAD.

#define SAIGE_SET_OBJECT_SCORE_THRESHOLD 0x1000

See also: SaigeInferenceOption::objectScoreThresholdPerClass, SaigeInferenceOption::objectScoreThreshold

SAIGE_SET_CALC_MASK

(SEG, IAD) Flag to set the calcMask option.

#define SAIGE_SET_CALC_MASK 0x2000

See also: SaigeInferenceOption::calcMask

SAIGE_SET_CALC_HEATMAP

(IAD) Flag to set the calcHeatmap option.

#define SAIGE_SET_CALC_HEATMAP 0x4000

See also: SaigeInferenceOption::calcHeatmap

SAIGE_SET_ANOMALY_SCORE_THRESHOLD

(IAD) Flag to set the anomalyScoreThreshold option.

#define SAIGE_SET_ANOMALY_SCORE_THRESHOLD 0x8000

See also: SaigeInferenceOption::anomalyScoreThreshold

SAIGE_SET_HEATMAP_COLOR_RANGE

(IAD) Flag to set heatmapColorRangeMin and heatmapColorRangeMax options.

#define SAIGE_SET_HEATMAP_COLOR_RANGE 0x10000

See also: SaigeInferenceOption::heatmapColorRangeMin, SaigeInferenceOption::heatmapColorRangeMax

SAIGE_SET_POLYGON_SCORE_THRESHOLD

(OCR) Flag to set the polygonScoreThreshold option.

#define SAIGE_SET_POLYGON_SCORE_THRESHOLD 0x20000

See also: SaigeInferenceOption::polygonScoreThreshold

SAIGE_SET_TEXT_SIZE_RANGE

(OCR) Flag to set textSizeRangeMin and textSizeRangeMax options.

#define SAIGE_SET_TEXT_SIZE_RANGE 0x40000

See also: SaigeInferenceOption::textSizeRangeMin, SaigeInferenceOption::textSizeRangeMax

SAIGE_SET_NUM_OF_TEXT_OBJECTS

(OCR) Flag to set the maxNumOfTextObjects option.

#define SAIGE_SET_NUM_OF_TEXT_OBJECTS 0x80000

See also: SaigeInferenceOption::maxNumOfTextObjects

SAIGE_SET_TEXT_SCORE_THRESHOLD

(OCR) Flag to set the textScoreThreshold option.

#define SAIGE_SET_TEXT_SCORE_THRESHOLD 0x100000

See also: SaigeInferenceOption::textScoreThreshold

SAIGE_SET_TEXT_FORMATTING

(OCR) Flag to set the textFormatting option.

#define SAIGE_SET_TEXT_FORMATTING 0x200000

SAIGE_DO_NOT_INSPECT

(SEG) An option for oversizedImageHandling, where inference is not performed and an error is raised.

#define SAIGE_DO_NOT_INSPECT "do_not_inspect"

See also: SaigeInferenceOption::oversizedImageHandling

SAIGE_DO_NOT_ENHANCE

(IEN) An option for oversizedImageHandling, where inference is not performed and an error is raised.

#define SAIGE_DO_NOT_ENHANCE "do_not_enhance"

See also: SaigeInferenceOption::oversizedImageHandling

SAIGE_RESIZE_TO_FIT

(SEG) An option for oversizedImageHandling. When set, the image is resized to fit within the inspection size, maintaining its aspect ratio, and then inference is performed.

#define SAIGE_RESIZE_TO_FIT "resize_to_fit"

See also: SaigeInferenceOption::oversizedImageHandling

SAIGE_CROP_INTO_TILES

(SEG, IEN) An option for oversizedImageHandling. When set, the image is cropped into tiles based on the inspection size. Inference is performed on each tile, and results are combined.

#define SAIGE_CROP_INTO_TILES "crop_into_tiles"

See also: SaigeInferenceOption::oversizedImageHandling