Parameter Types#

IParameter#

class IParameter#

Subclassed by aidi::param::BinaryPacks, aidi::param::BinaryTrainingParameters, aidi::param::IConfusionMatrixList, aidi::param::IPrecisionEvaluation, aidi::param::LabelClasses, aidi::param::SchemableParameter, aidi::param::ViewTransformParameterList

ISchemable#

struct ISchemable#

Json Schemable Class API.

A Json Schemable Class is a class that can be serialized to/deserialized from Json and can be validated by Json Schema.

Subclassed by aidi::param::AssemblyVerificationLayOutArea, aidi::param::AssemblyVerificationMaxInputSize, aidi::param::AxialSideLengthRange, aidi::param::ClassificationInputShape, aidi::param::DataAugmentation, aidi::param::DetectionInputShape, aidi::param::DetectionTrainingStrategy, aidi::param::ExampleAugRotate, aidi::param::ExampleAugShift, aidi::param::FilterScript, aidi::param::GeoAugDistortion, aidi::param::GeoAugScale, aidi::param::GeoAugShift, aidi::param::GeoAugSlightRotation, aidi::param::GeometryAugmentation, aidi::param::ImageAugBlur, aidi::param::ImageAugBrightness, aidi::param::ImageAugColorFilter, aidi::param::ImageAugContrast, aidi::param::ImageAugIllumGradient, aidi::param::ImageAugNoise, aidi::param::ImageAugSharpen, aidi::param::ImageAugmentation, aidi::param::ImageEnhancementLEP, aidi::param::KeyPointNode, aidi::param::LocationMaxInputSize, aidi::param::LocationModelParameters, aidi::param::LocationTargetParameters, aidi::param::LossCurve, aidi::param::MultiNameKeyPointNode, aidi::param::NodeMatchTemplate, aidi::param::OCRAnnulusParameters, aidi::param::OCRNodeTemplate, aidi::param::OCRStringTemplate, aidi::param::RegularExpression, aidi::param::SchemableParameter, aidi::param::SegmentationImageSplit, aidi::param::SegmentationInputShape, aidi::param::SegmentationModelParameters, aidi::param::SegmentationTrainingSampleStrategy, aidi::param::SideLengthRange, aidi::param::SingleClassPolygonsFilterParamters, aidi::param::UnsuperClassificationInputShape, aidi::param::UnsuperDefectRadius, aidi::param::UnsuperSegmentationInputShape, aidi::param::UnsuperSegmentationModelParameters, aidi::param::UnsuperSegmentationSamplingParameters

Public Functions

virtual const std::string &schema_str() const = 0#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const = 0#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

const void* The nlohmann::json object pointer

virtual aidi::Buffer to_json() const = 0#

Serialize the parameter group to schema-validatable json string.

Returns:

aidi::Buffer the schema-validatable json string.

virtual ISchemable &from_json(const aidi::Buffer &json_str) = 0#

Deserialize the parameter group from schema-validatable json string.

See also

validate(const std::string &json_str, std::string *error_msg = nullptr)

Parameters:

json_str[in] the schema-validatable json string.

Throws:
Returns:

ISchemable& the reference of the parameter.

bool validate(const aidi::Buffer &json_str, std::string *error_msg = nullptr) const#

Validate the parameter json string with json schema.

Parameters:
  • json_str[in] the json string.

  • error_msg[out] the error message if the json string is invalid, otherwise empty.

Throws:

aidi::excepts::InvalidJson – if the json string is invalid.

Returns:

bool true if the json string is valid, otherwise false.

SchemableParameter#

struct SchemableParameter : public virtual aidi::param::IParameter, public virtual aidi::param::ISchemable#

SchemableParameter feature interface for IParameter classes.

Subclassed by aidi::param::AssemblyVerificationFilterParameters, aidi::param::AssemblyVerificationTemplates, aidi::param::AssemblyVerificationTrainingParameters, aidi::param::BaseColor, aidi::param::ClassificationInferParameters, aidi::param::ClassificationTrainingParameters, aidi::param::DetectionInferParameters, aidi::param::DetectionTrainingParameters, aidi::param::ExampleAugments, aidi::param::FeatureMapFilterParameters, aidi::param::ImageMean, aidi::param::InferenceBatchSize, aidi::param::InputImageParam, aidi::param::LocationFilterParameters, aidi::param::LocationTemplates, aidi::param::LocationTrainingParameters, aidi::param::OCRFilterParameters, aidi::param::OCRInferParameters, aidi::param::OCRTemplates, aidi::param::OCRTrainingParameters, aidi::param::PolygonsFilterParamters, aidi::param::SegmentationTrainingParameters, aidi::param::TRTCalibParameters, aidi::param::TrainingLog, aidi::param::UnsuperClassificationInferingParameters, aidi::param::UnsuperClassificationTrainingParameters, aidi::param::UnsuperSegmentationInferingParameters, aidi::param::UnsuperSegmentationTrainingParameters, aidi::param::ViewFilterParameters

Customize Parameters#

class BinaryPacks : public aidi::param::IParameter#

Parameter to store list of binary data with name.

Public Functions

void insert(const std::string &key, const aidi::Buffer &buffer)#

Insert a new binary data into the BinaryPacks. Old data with the same key will be replaced.

See also

aidi::Buffer

See also

get(const std::string &key)

Note

The data in the buffer will not be copied, Which means that if you modify the data content in the Buffer later, the data in the inserted Buffer will also be modified. If this is not the behavior you expect, you can call aidi::Buffer::clone_data() explicitly like below:

binary_packs.insert("my-data", buffer.clone_data());

Parameters:
  • key – The key of the binary data.

  • buffer – The binary data.

void remove(const std::string &key)#

Remove binary data specified by the key. Do nothing if the key not found.

Parameters:

key – The key of the binary data to be removed.

bool contains(const std::string &key) const#

Check if the binary data exists in the container.

Parameters:

key – The key of the binary data

Returns:

True if exists. Else false.

const aidi::Buffer &get(const std::string &key) const#

Get the binary data specified by the key.

Note

Do not modify the data in the buffer with out clone,

Parameters:

key

Returns:

const aidi::Buffer & The reference of the binary data.

std::vector<std::string> keys() const#

Get all keys in the BinaryPacks.

Returns:

std::vector<std::string> The keys list.

void clear()#

Clear the container.

InputImage Parameters#

enum aidi::param::ColorType#

Values:

enumerator kGray = 1#
enumerator kBGR = 3#
class BaseColor : public aidi::param::SchemableParameter#

BaseColor Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const ColorType &get_color() const#

Get base_color.

Convert all images into Gray or BGR color space

See also

set_color()

Returns:

const ColorType & base_color

BaseColor &set_color(const ColorType &color)#

Set base_color with ColorType value.

Convert all images into Gray or BGR color space

See also

get_color()

Parameters:

color – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

BaseColor& the reference of this object.

class ImageMean : public aidi::param::SchemableParameter#

ImageMean Parameter class generated by jinja2 automatically.

Image mean parameters

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const std::vector<double> &get_values() const#

Get image mean.

image mean values ordered same as image channels

See also

set_values()

Returns:

const std::vector<double> & image mean

ImageMean &set_values(const std::vector<double> &values)#

Set image mean with std::vector<double> value.

image mean values ordered same as image channels

See also

get_values()

Parameters:

values – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageMean& the reference of this object.

double get_values(size_t index) const#

Get value in image mean with index.

Warning

The index must be less than get_values_size(). otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

double value in image mean at index.

size_t get_values_size() const#

Get the size of image mean.

Returns:

size_t the size of image mean

class InputImageParam : public aidi::param::SchemableParameter#

InputImageParam Parameter class generated by jinja2 automatically.

输入图像相关参数,用于控制工程的输入图像格式规范.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_visual_size() const#

Get 可视图象数.

一个aidi.Image允许包含的可视图象数量, 多数情况下, 使用默认值1即可。若需要将多张图像当作一张图像处理, 可以设置为大于1的值。

Returns:

int 可视图象数

InputImageParam &set_visual_size(int visual_size)#

Set 可视图象数 with int value.

一个aidi.Image允许包含的可视图象数量, 多数情况下, 使用默认值1即可。若需要将多张图像当作一张图像处理, 可以设置为大于1的值。

Parameters:

visual_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

InputImageParam& the reference of this object.

class LabelClasses : public aidi::param::IParameter#

LabelClasses is a parameter to manage label classes.

Public Functions

void add(const std::string &label_name)#

Add a label name into the label classes container.

Parameters:

label_name – The label name to be added.

void remove(const std::string &label_name)#

Remove a label name from the label classes container.

Parameters:

label_name – The label name to be removed.

size_t size() const#

Get the number of label classes.

Returns:

The number of label classes.

inline bool empty() const#

Check if the container is empty.

Returns:

bool True if the container is empty.

bool contains(const std::string &label_name) const#

Check if the label classes container contains the label name.

Parameters:

label_name – The label name to be checked.

Returns:

True if the label classes container contains the label name.

std::vector<std::string> get() const#

Get all label names in the label classes container as a vector.

Returns:

std::vector<std::string> The label names in the label classes

void clear()#

Clear the label classes container.

EvaluationMetrics Parameters#

enum aidi::param::ConfusionMatrixType#

Values:

enumerator kImage = 0#

Confusion matrix for all images.

enumerator kAllView = 1#

Confusion matrix for all views.

enumerator kTestView = 2#

Confusion matrix for all test set views.

enumerator kTrainView = 3#

Confusion matrix for all train set views.

enumerator kAllRegion = 4#

Confusion matrix for all regions.

enumerator kTestRegion = 5#

Confusion matrix for all test set regions.

enumerator kTrainRegion = 6#

Confusion matrix for all train set regions.

enumerator kAllPixel = 7#

Confusion matrix for all pixels.

enumerator kTestPixel = 8#

Confusion matrix for all test set pixels.

enumerator kTrainPixel = 9#

Confusion matrix for all train set pixels.

enum aidi::param::PrecisionEvaluationType#

Values:

enumerator kAngle = 0#

Precision evaluation of angle.

enumerator kPosition = 1#

Precision evaluationfor of position.

class Table#

Public Functions

size_t rows() const#

The number of rows.

Returns:

size_t

size_t cols() const#

The number of columns.

Returns:

size_t

const std::vector<std::string> &row_header() const#

Get the row header.

Returns:

std::vector<std::string> The row header.

const std::vector<std::string> &col_header() const#

Get the column header.

Returns:

std::vector<std::string> The column header.

std::vector<int> row_data(size_t row) const#

Get the data of one row.

Parameters:

row – The index of rows.

Throws:

excepts::DataNotFound – If no such the row.

Returns:

std::vector<int> The data of one row.

std::vector<int> col_data(size_t col) const#

Get the data of one column.

Parameters:

col – The index of columns.

Throws:

excepts::DataNotFound – If no such the column.

Returns:

std::vector<int> The data of one column.

int data(size_t row, size_t col) const#

Get the data of the specific position in the confusion matrix.

Parameters:
  • row – The index of rows.

  • col – The index of columns.

Throws:

excepts::DataNotFound – If no such the row or column.

Returns:

int

int &data(size_t row, size_t col)#

Get the reference of the data of the specific position in the confusion matrix.

Parameters:
  • row – The index of rows.

  • col – The index of columns.

Throws:

excepts::DataNotFound – If no such the row or column.

Returns:

NO_DISCARD&

Table &reset_header(const std::vector<std::string> &row_header, const std::vector<std::string> &col_header)#

Reset the header of the confusion matrix.

Note

If no header is set at construction time,then the first task is to reset header. The number of rows and columns of this matrix will be initialized by the length of the row and column header. If the header has been set before, the reset header will clear the previous data, please be careful.

Parameters:
  • row_header – The header of row.

  • col_header – The header of column.

Returns:

Table&

Table &set_row_data(size_t row, const std::vector<int> &data)#

Set the data of one row.

Parameters:
  • row – The index of rows.

  • data

Throws:
Returns:

Table&

Table &set_col_data(size_t col, const std::vector<int> &data)#

Set the data of one column.

Parameters:
  • col – The index of columns.

  • data

Throws:
Returns:

Table&

Table &set_data(size_t row, size_t col, int data)#

Set the data of the specific position in the confusion matrix.

Parameters:
  • row – The index of rows.

  • col – The index of columns.

  • data

Throws:

excepts::DataNotFound – If no such the row or column.

Returns:

Table&

class DataMetrics#

Public Functions

float maximum() const#

Get the maximum.

Returns:

NO_DISCARD

float minimum() const#

Get the minimum.

Returns:

NO_DISCARD

float average() const#

Get the average.

Returns:

NO_DISCARD

float standard_deviation() const#

Get the standard deviation.

Returns:

NO_DISCARD

DataMetrics &set_maximum(float value)#

Set the maximum.

Parameters:

value

Returns:

DataMetrics&

DataMetrics &set_minimum(float value)#

Set the minimum.

Parameters:

value

Returns:

DataMetrics&

DataMetrics &set_average(float value)#

Set the average.

Parameters:

value

Returns:

DataMetrics&

DataMetrics &set_standard_deviation(float value)#

Set the standard deviation.

Parameters:

value

Returns:

DataMetrics&

class ConfusionMatrix#

Public Functions

ConfusionMatrixType type() const#

Get the type of the confusion matrix.

Returns:

NO_DISCARD

const Table &table() const#

Get the table.

Returns:

NO_DISCARD

Table &table()#

Get reference of the table.

Returns:

NO_DISCARD&

ConfusionMatrix &set_table(const Table &table)#

Set the table.

Parameters:

table

Returns:

ConfusionMatrix&

bool has_precision_and_recall() const#

Whether the confusion matrix has precision and recall properties.

Note

The property is set by the constructor.

Returns:

true

Returns:

false

float precision() const#

Get the precision of the confusion matrix.

Note

Returns -1, if there is no precision property.

Returns:

NO_DISCARD

float recall() const#

Get the recall of the confusion matrix.

Note

Returns -1, if there is no recall property.

Returns:

NO_DISCARD

struct IPrecisionEvaluation : public virtual aidi::param::IParameter#

IPrecisionEvaluation feature interface for IParameter classes.

Subclassed by aidi::param::LocationModelEvaluationMetrics

Public Functions

virtual std::set<PrecisionEvaluationType> precision_evaluation_keys() const = 0#

Get the types of precision evaluation in this map.

Returns:

std::set<PrecisionEvaluationType>

virtual const DataMetrics &precision_evaluation(PrecisionEvaluationType type) const = 0#

Get the precision evaluation with the type.

Parameters:

type

Returns:

NO_DISCARD

virtual DataMetrics &precision_evaluation(PrecisionEvaluationType type) = 0#

Get the reference precision evaluation with the type.

Parameters:

type

Returns:

NO_DISCARD

virtual IPrecisionEvaluation &set_precision_evaluation(PrecisionEvaluationType type, const DataMetrics &data_metrics) = 0#

Set the precision evaluation with the type.

Parameters:
  • type

  • data_metrics

Returns:

IPrecisionEvaluation&

struct IConfusionMatrixList : public virtual aidi::param::IParameter#

IConfusionMatrixList feature interface for IParameter classes.

Subclassed by aidi::param::LocationModelEvaluationMetrics, aidi::param::ModelEvaluationMetrics

Public Functions

virtual std::set<ConfusionMatrixType> confusion_matrix_keys() const = 0#

Get the types of confusion matrix in this map.

Returns:

std::set<ConfusionMatrixType>

virtual const ConfusionMatrix &confusion_matrix(ConfusionMatrixType type) const = 0#

Get the confusion matrix with the type.

Parameters:

type

Returns:

NO_DISCARD

virtual ConfusionMatrix &confusion_matrix(ConfusionMatrixType type) = 0#

Get the reference confusion matrix with the type.

Parameters:

type

Returns:

NO_DISCARD

virtual IConfusionMatrixList &set_confusion_matrix(const ConfusionMatrix &confusion_matrix) = 0#

Set the confusion matrix.

Parameters:

confusion_matrix

Returns:

IConfusionMatrixList&

class ModelEvaluationMetrics : public virtual aidi::param::IConfusionMatrixList#

Public Functions

virtual std::set<ConfusionMatrixType> confusion_matrix_keys() const override#

Get the types of confusion matrix in this map.

Returns:

std::set<ConfusionMatrixType>

virtual const ConfusionMatrix &confusion_matrix(ConfusionMatrixType type) const override#

Get the confusion matrix with the type.

Parameters:

type

Throws:

excepts::DataNotFound – The confusion matrix with the type does not exist.

Returns:

NO_DISCARD

virtual ConfusionMatrix &confusion_matrix(ConfusionMatrixType type) override#

Get the reference confusion matrix with the type.

Parameters:

type

Throws:

excepts::DataNotFound – The confusion matrix with the type does not exist.

Returns:

NO_DISCARD

virtual ModelEvaluationMetrics &set_confusion_matrix(const ConfusionMatrix &confusion_matrix) override#

Set the confusion matrix.

Parameters:

confusion_matrix

Returns:

ModelEvaluationMetrics&

class LocationModelEvaluationMetrics : public virtual aidi::param::IConfusionMatrixList, public virtual aidi::param::IPrecisionEvaluation#

Public Functions

virtual std::set<ConfusionMatrixType> confusion_matrix_keys() const override#

Get the types of confusion matrix in this map.

Returns:

std::set<ConfusionMatrixType>

virtual const ConfusionMatrix &confusion_matrix(ConfusionMatrixType type) const override#

Get the confusion matrix with the type.

Parameters:

type

Throws:

excepts::DataNotFound – The confusion matrix with the type does not exist.

Returns:

NO_DISCARD

virtual ConfusionMatrix &confusion_matrix(ConfusionMatrixType type) override#

Get the reference confusion matrix with the type.

Parameters:

type

Throws:

excepts::DataNotFound – The confusion matrix with the type does not exist.

Returns:

NO_DISCARD

virtual LocationModelEvaluationMetrics &set_confusion_matrix(const ConfusionMatrix &confusion_matrix) override#

Set the confusion matrix.

Parameters:

confusion_matrix

Returns:

ModelEvaluationMetrics&

virtual std::set<PrecisionEvaluationType> precision_evaluation_keys() const override#

Get the types of precision evaluation in this map.

Returns:

std::set<PrecisionEvaluationType>

virtual const DataMetrics &precision_evaluation(PrecisionEvaluationType type) const override#

Get the precision evaluation with the type.

Parameters:

type

Throws:

excepts::DataNotFound – The precision evaluation with the type does not exist.

Returns:

NO_DISCARD

virtual DataMetrics &precision_evaluation(PrecisionEvaluationType type) override#

Get the reference precision evaluation with the type.

Parameters:

type

Throws:

excepts::DataNotFound – The precision evaluation with the type does not exist.

Returns:

NO_DISCARD

virtual LocationModelEvaluationMetrics &set_precision_evaluation(PrecisionEvaluationType type, const DataMetrics &data_metrics) override#

Set the precision evaluation with the type.

Parameters:
  • type

  • data_metrics

Returns:

LocationModelEvaluationMetrics&

DataAugmentation Parameters#

class GeoAugSlightRotation : public aidi::param::ISchemable#

GeoAugSlightRotation Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Enable to augment training data with slight rotation

See also

set_enable()

Returns:

bool Enable

GeoAugSlightRotation &set_enable(bool enable)#

Set Enable with bool value.

Enable to augment training data with slight rotation

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugSlightRotation& the reference of this object.

const std::vector<double> &get_range() const#

Get Angle Range.

Slight rotation angle range (min, max)

See also

set_range()

Returns:

const std::vector<double> & Angle Range

GeoAugSlightRotation &set_range(const std::vector<double> &range)#

Set Angle Range with std::vector<double> value.

Slight rotation angle range (min, max)

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugSlightRotation& the reference of this object.

bool range_contains(double value) const#

Check if the Angle Range contains the value.

Returns:

bool true if the Angle Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Angle Range.

Returns:

const std::vector<double> & left point value of Angle Range

double get_range_right() const#

Get the right point value of Angle Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Angle Range

GeoAugSlightRotation &set_range_left(double range_left)#

Set left point value of Angle Range with std::vector<double> value.

Slight rotation angle range (min, max)

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugSlightRotation& the reference of this object.

GeoAugSlightRotation &set_range_right(double range_right)#

Set the right point value of Angle Range with std::vector<double> value.

Slight rotation angle range (min, max)

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugSlightRotation& the reference of this object.

int get_step() const#

Get Angle Step.

Slight rotation angle step

See also

set_step()

Returns:

int Angle Step

GeoAugSlightRotation &set_step(int step)#

Set Angle Step with int value.

Slight rotation angle step

See also

get_step()

Parameters:

step – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugSlightRotation& the reference of this object.

class GeoAugShift : public aidi::param::ISchemable#

GeoAugShift Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Enable to randomly shift the tranning data horizontally and vertically by a certain proportion

See also

set_enable()

Returns:

bool Enable

GeoAugShift &set_enable(bool enable)#

Set Enable with bool value.

Enable to randomly shift the tranning data horizontally and vertically by a certain proportion

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugShift& the reference of this object.

double get_shift_vertical() const#

Get Vertical Shift.

Vertical shift

Returns:

double Vertical Shift

GeoAugShift &set_shift_vertical(double shift_vertical)#

Set Vertical Shift with double value.

Vertical shift

Parameters:

shift_vertical – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugShift& the reference of this object.

double get_shift_horizontal() const#

Get Horizontal Shift.

Horizontal shift

Returns:

double Horizontal Shift

GeoAugShift &set_shift_horizontal(double shift_horizontal)#

Set Horizontal Shift with double value.

Horizontal shift

Parameters:

shift_horizontal – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugShift& the reference of this object.

class GeoAugScale : public aidi::param::ISchemable#

GeoAugScale Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Enable to randomly scale the tranning data by a certain proportion

See also

set_enable()

Returns:

bool Enable

GeoAugScale &set_enable(bool enable)#

Set Enable with bool value.

Enable to randomly scale the tranning data by a certain proportion

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugScale& the reference of this object.

const std::vector<double> &get_range() const#

Get Scale Range.

Scale range (min, max)

See also

set_range()

Returns:

const std::vector<double> & Scale Range

GeoAugScale &set_range(const std::vector<double> &range)#

Set Scale Range with std::vector<double> value.

Scale range (min, max)

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugScale& the reference of this object.

bool range_contains(double value) const#

Check if the Scale Range contains the value.

Returns:

bool true if the Scale Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Scale Range.

Returns:

const std::vector<double> & left point value of Scale Range

double get_range_right() const#

Get the right point value of Scale Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Scale Range

GeoAugScale &set_range_left(double range_left)#

Set left point value of Scale Range with std::vector<double> value.

Scale range (min, max)

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugScale& the reference of this object.

GeoAugScale &set_range_right(double range_right)#

Set the right point value of Scale Range with std::vector<double> value.

Scale range (min, max)

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugScale& the reference of this object.

class GeoAugDistortion : public aidi::param::ISchemable#

GeoAugDistortion Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Enable to randomly distort the training data to simulate image distortion caused by factors such as lens aging.

See also

set_enable()

Returns:

bool Enable

GeoAugDistortion &set_enable(bool enable)#

Set Enable with bool value.

Enable to randomly distort the training data to simulate image distortion caused by factors such as lens aging.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugDistortion& the reference of this object.

const std::vector<double> &get_range() const#

Get Distortion Strength Range.

Distortion Strength range, From 0 to 2, the distortion effect gradually increases

See also

set_range()

Returns:

const std::vector<double> & Distortion Strength Range

GeoAugDistortion &set_range(const std::vector<double> &range)#

Set Distortion Strength Range with std::vector<double> value.

Distortion Strength range, From 0 to 2, the distortion effect gradually increases

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugDistortion& the reference of this object.

bool range_contains(double value) const#

Check if the Distortion Strength Range contains the value.

Returns:

bool true if the Distortion Strength Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Distortion Strength Range.

Returns:

const std::vector<double> & left point value of Distortion Strength Range

double get_range_right() const#

Get the right point value of Distortion Strength Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Distortion Strength Range

GeoAugDistortion &set_range_left(double range_left)#

Set left point value of Distortion Strength Range with std::vector<double> value.

Distortion Strength range, From 0 to 2, the distortion effect gradually increases

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugDistortion& the reference of this object.

GeoAugDistortion &set_range_right(double range_right)#

Set the right point value of Distortion Strength Range with std::vector<double> value.

Distortion Strength range, From 0 to 2, the distortion effect gradually increases

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeoAugDistortion& the reference of this object.

class GeometryAugmentation : public aidi::param::ISchemable#

GeometryAugmentation Parameter class generated by jinja2 automatically.

Geometry augmentation parameters

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_flip_vertical() const#

Get Vertical Flip.

Flip training images vertically randomly with a probability of 0.5

Returns:

bool Vertical Flip

GeometryAugmentation &set_flip_vertical(bool flip_vertical)#

Set Vertical Flip with bool value.

Flip training images vertically randomly with a probability of 0.5

Parameters:

flip_vertical – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeometryAugmentation& the reference of this object.

bool get_flip_horizontal() const#

Get Horizontal Flip.

Flip training images horizontally randomly with a probability of 0.5

Returns:

bool Horizontal Flip

GeometryAugmentation &set_flip_horizontal(bool flip_horizontal)#

Set Horizontal Flip with bool value.

Flip training images horizontally randomly with a probability of 0.5

Parameters:

flip_horizontal – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeometryAugmentation& the reference of this object.

bool get_rotate_90() const#

Get Vertical Rotation.

Rotate the training image by a multiple of 90 degrees at random

See also

set_rotate_90()

Returns:

bool Vertical Rotation

GeometryAugmentation &set_rotate_90(bool rotate_90)#

Set Vertical Rotation with bool value.

Rotate the training image by a multiple of 90 degrees at random

See also

get_rotate_90()

Parameters:

rotate_90 – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeometryAugmentation& the reference of this object.

bool get_rotate_180() const#

Get Centrosymmetric Rotation.

Rotate the training image by a multiple of 180 degrees at random

See also

set_rotate_180()

Returns:

bool Centrosymmetric Rotation

GeometryAugmentation &set_rotate_180(bool rotate_180)#

Set Centrosymmetric Rotation with bool value.

Rotate the training image by a multiple of 180 degrees at random

See also

get_rotate_180()

Parameters:

rotate_180 – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeometryAugmentation& the reference of this object.

const GeoAugSlightRotation &get_slight_rotate() const#

Get Slight Rotation.

Slight rotation augmentation parameters

Returns:

const GeoAugSlightRotation & Slight Rotation

GeometryAugmentation &set_slight_rotate(const GeoAugSlightRotation &slight_rotate)#

Set Slight Rotation with GeoAugSlightRotation value.

Slight rotation augmentation parameters

Parameters:

slight_rotate – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeometryAugmentation& the reference of this object.

GeoAugSlightRotation &get_slight_rotate()#

Get mutable reference of Slight Rotation.

Slight rotation augmentation parameters

Returns:

GeometryAugmentation& the mutable reference of the group.

const GeoAugShift &get_shift() const#

Get Shift.

Shift augmentations parameters

See also

set_shift()

Returns:

const GeoAugShift & Shift

GeometryAugmentation &set_shift(const GeoAugShift &shift)#

Set Shift with GeoAugShift value.

Shift augmentations parameters

See also

get_shift()

Parameters:

shift – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeometryAugmentation& the reference of this object.

GeoAugShift &get_shift()#

Get mutable reference of Shift.

Shift augmentations parameters

Returns:

GeometryAugmentation& the mutable reference of the group.

const GeoAugScale &get_scale() const#

Get Scale.

Scale augmentations parameters

See also

set_scale()

Returns:

const GeoAugScale & Scale

GeometryAugmentation &set_scale(const GeoAugScale &scale)#

Set Scale with GeoAugScale value.

Scale augmentations parameters

See also

get_scale()

Parameters:

scale – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeometryAugmentation& the reference of this object.

GeoAugScale &get_scale()#

Get mutable reference of Scale.

Scale augmentations parameters

Returns:

GeometryAugmentation& the mutable reference of the group.

const GeoAugDistortion &get_distortion() const#

Get Distortion.

Distortion augmentations parameters

See also

set_distortion()

Returns:

const GeoAugDistortion & Distortion

GeometryAugmentation &set_distortion(const GeoAugDistortion &distortion)#

Set Distortion with GeoAugDistortion value.

Distortion augmentations parameters

See also

get_distortion()

Parameters:

distortion – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeometryAugmentation& the reference of this object.

GeoAugDistortion &get_distortion()#

Get mutable reference of Distortion.

Distortion augmentations parameters

Returns:

GeometryAugmentation& the mutable reference of the group.

bool get_crop() const#

Get Crop Overflow Area.

Crop out spill areas caused by geometric transformations (translation, rotation) to keep the image size unchanged

See also

set_crop()

Returns:

bool Crop Overflow Area

GeometryAugmentation &set_crop(bool crop)#

Set Crop Overflow Area with bool value.

Crop out spill areas caused by geometric transformations (translation, rotation) to keep the image size unchanged

See also

get_crop()

Parameters:

crop – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

GeometryAugmentation& the reference of this object.

class ImageAugBrightness : public aidi::param::ISchemable#

ImageAugBrightness Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Brightness Augmentation.

Enable illumination augmentation to augment training data with linear gray scale transformations

See also

set_enable()

Returns:

bool Enable Brightness Augmentation

ImageAugBrightness &set_enable(bool enable)#

Set Enable Brightness Augmentation with bool value.

Enable illumination augmentation to augment training data with linear gray scale transformations

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugBrightness& the reference of this object.

const std::vector<double> &get_range() const#

Get Brightness Range.

The illumination intensity range 0~1 for reduction, and 1~2 for enhancement.

See also

set_range()

Returns:

const std::vector<double> & Brightness Range

ImageAugBrightness &set_range(const std::vector<double> &range)#

Set Brightness Range with std::vector<double> value.

The illumination intensity range 0~1 for reduction, and 1~2 for enhancement.

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugBrightness& the reference of this object.

bool range_contains(double value) const#

Check if the Brightness Range contains the value.

Returns:

bool true if the Brightness Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Brightness Range.

Returns:

const std::vector<double> & left point value of Brightness Range

double get_range_right() const#

Get the right point value of Brightness Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Brightness Range

ImageAugBrightness &set_range_left(double range_left)#

Set left point value of Brightness Range with std::vector<double> value.

The illumination intensity range 0~1 for reduction, and 1~2 for enhancement.

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugBrightness& the reference of this object.

ImageAugBrightness &set_range_right(double range_right)#

Set the right point value of Brightness Range with std::vector<double> value.

The illumination intensity range 0~1 for reduction, and 1~2 for enhancement.

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugBrightness& the reference of this object.

class ImageAugContrast : public aidi::param::ISchemable#

ImageAugContrast Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Contrast Augmentation.

Enable contrast augmentation to simulate the effect of different lighting conditions with different contrast

See also

set_enable()

Returns:

bool Enable Contrast Augmentation

ImageAugContrast &set_enable(bool enable)#

Set Enable Contrast Augmentation with bool value.

Enable contrast augmentation to simulate the effect of different lighting conditions with different contrast

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugContrast& the reference of this object.

const std::vector<double> &get_range() const#

Get Contrast Range.

The contrast range 0~1 for reduction, and 1~2 for enhancement.

See also

set_range()

Returns:

const std::vector<double> & Contrast Range

ImageAugContrast &set_range(const std::vector<double> &range)#

Set Contrast Range with std::vector<double> value.

The contrast range 0~1 for reduction, and 1~2 for enhancement.

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugContrast& the reference of this object.

bool range_contains(double value) const#

Check if the Contrast Range contains the value.

Returns:

bool true if the Contrast Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Contrast Range.

Returns:

const std::vector<double> & left point value of Contrast Range

double get_range_right() const#

Get the right point value of Contrast Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Contrast Range

ImageAugContrast &set_range_left(double range_left)#

Set left point value of Contrast Range with std::vector<double> value.

The contrast range 0~1 for reduction, and 1~2 for enhancement.

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugContrast& the reference of this object.

ImageAugContrast &set_range_right(double range_right)#

Set the right point value of Contrast Range with std::vector<double> value.

The contrast range 0~1 for reduction, and 1~2 for enhancement.

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugContrast& the reference of this object.

class ImageAugColorFilter : public aidi::param::ISchemable#

ImageAugColorFilter Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Color Filter.

Simulate the different colors lighting effects by adding filters (only color images are supported), the color filter intensity controls the max intensity of the allowed color filters, range 0~2 from low to high.

See also

set_enable()

Returns:

bool Enable Color Filter

ImageAugColorFilter &set_enable(bool enable)#

Set Enable Color Filter with bool value.

Simulate the different colors lighting effects by adding filters (only color images are supported), the color filter intensity controls the max intensity of the allowed color filters, range 0~2 from low to high.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugColorFilter& the reference of this object.

const std::vector<double> &get_range() const#

Get Color Filter Range.

Color Filter Range 0~2 from low to high.

See also

set_range()

Returns:

const std::vector<double> & Color Filter Range

ImageAugColorFilter &set_range(const std::vector<double> &range)#

Set Color Filter Range with std::vector<double> value.

Color Filter Range 0~2 from low to high.

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugColorFilter& the reference of this object.

bool range_contains(double value) const#

Check if the Color Filter Range contains the value.

Returns:

bool true if the Color Filter Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Color Filter Range.

Returns:

const std::vector<double> & left point value of Color Filter Range

double get_range_right() const#

Get the right point value of Color Filter Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Color Filter Range

ImageAugColorFilter &set_range_left(double range_left)#

Set left point value of Color Filter Range with std::vector<double> value.

Color Filter Range 0~2 from low to high.

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugColorFilter& the reference of this object.

ImageAugColorFilter &set_range_right(double range_right)#

Set the right point value of Color Filter Range with std::vector<double> value.

Color Filter Range 0~2 from low to high.

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugColorFilter& the reference of this object.

class ImageAugNoise : public aidi::param::ISchemable#

ImageAugNoise Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Noise.

Enable noise augmentation to augment training data with Gaussian noise

See also

set_enable()

Returns:

bool Enable Noise

ImageAugNoise &set_enable(bool enable)#

Set Enable Noise with bool value.

Enable noise augmentation to augment training data with Gaussian noise

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugNoise& the reference of this object.

const std::vector<double> &get_range() const#

Get Noise Range.

Noise Range 0~2 from low to high.

See also

set_range()

Returns:

const std::vector<double> & Noise Range

ImageAugNoise &set_range(const std::vector<double> &range)#

Set Noise Range with std::vector<double> value.

Noise Range 0~2 from low to high.

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugNoise& the reference of this object.

bool range_contains(double value) const#

Check if the Noise Range contains the value.

Returns:

bool true if the Noise Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Noise Range.

Returns:

const std::vector<double> & left point value of Noise Range

double get_range_right() const#

Get the right point value of Noise Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Noise Range

ImageAugNoise &set_range_left(double range_left)#

Set left point value of Noise Range with std::vector<double> value.

Noise Range 0~2 from low to high.

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugNoise& the reference of this object.

ImageAugNoise &set_range_right(double range_right)#

Set the right point value of Noise Range with std::vector<double> value.

Noise Range 0~2 from low to high.

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugNoise& the reference of this object.

class ImageAugIllumGradient : public aidi::param::ISchemable#

ImageAugIllumGradient Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Illumination Gradient.

Simulate the illumination intensity changing gradiently caused by the shift of the light position, the illumination intensity range 0~2 from low to high

See also

set_enable()

Returns:

bool Enable Illumination Gradient

ImageAugIllumGradient &set_enable(bool enable)#

Set Enable Illumination Gradient with bool value.

Simulate the illumination intensity changing gradiently caused by the shift of the light position, the illumination intensity range 0~2 from low to high

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugIllumGradient& the reference of this object.

const std::vector<double> &get_range() const#

Get Illumination Gradient Range.

Illumination Gradient Range 0~2 from low to high.

See also

set_range()

Returns:

const std::vector<double> & Illumination Gradient Range

ImageAugIllumGradient &set_range(const std::vector<double> &range)#

Set Illumination Gradient Range with std::vector<double> value.

Illumination Gradient Range 0~2 from low to high.

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugIllumGradient& the reference of this object.

bool range_contains(double value) const#

Check if the Illumination Gradient Range contains the value.

Returns:

bool true if the Illumination Gradient Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Illumination Gradient Range.

Returns:

const std::vector<double> & left point value of Illumination Gradient Range

double get_range_right() const#

Get the right point value of Illumination Gradient Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Illumination Gradient Range

ImageAugIllumGradient &set_range_left(double range_left)#

Set left point value of Illumination Gradient Range with std::vector<double> value.

Illumination Gradient Range 0~2 from low to high.

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugIllumGradient& the reference of this object.

ImageAugIllumGradient &set_range_right(double range_right)#

Set the right point value of Illumination Gradient Range with std::vector<double> value.

Illumination Gradient Range 0~2 from low to high.

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugIllumGradient& the reference of this object.

class ImageAugBlur : public aidi::param::ISchemable#

ImageAugBlur Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Blur.

Simulate the image blur caused by the out of focus, the effect of blur intensity range 0~2 from low to high

See also

set_enable()

Returns:

bool Enable Blur

ImageAugBlur &set_enable(bool enable)#

Set Enable Blur with bool value.

Simulate the image blur caused by the out of focus, the effect of blur intensity range 0~2 from low to high

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugBlur& the reference of this object.

const std::vector<double> &get_range() const#

Get Blur Range.

Blur intensity range 0~2 from low to high

See also

set_range()

Returns:

const std::vector<double> & Blur Range

ImageAugBlur &set_range(const std::vector<double> &range)#

Set Blur Range with std::vector<double> value.

Blur intensity range 0~2 from low to high

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugBlur& the reference of this object.

bool range_contains(double value) const#

Check if the Blur Range contains the value.

Returns:

bool true if the Blur Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Blur Range.

Returns:

const std::vector<double> & left point value of Blur Range

double get_range_right() const#

Get the right point value of Blur Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Blur Range

ImageAugBlur &set_range_left(double range_left)#

Set left point value of Blur Range with std::vector<double> value.

Blur intensity range 0~2 from low to high

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugBlur& the reference of this object.

ImageAugBlur &set_range_right(double range_right)#

Set the right point value of Blur Range with std::vector<double> value.

Blur intensity range 0~2 from low to high

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugBlur& the reference of this object.

class ImageAugSharpen : public aidi::param::ISchemable#

ImageAugSharpen Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Sharpening.

Simulate a scene with more accurate lens focus by sharpening the image, sharpening intensity range 0~2 from low to high

See also

set_enable()

Returns:

bool Enable Sharpening

ImageAugSharpen &set_enable(bool enable)#

Set Enable Sharpening with bool value.

Simulate a scene with more accurate lens focus by sharpening the image, sharpening intensity range 0~2 from low to high

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugSharpen& the reference of this object.

const std::vector<double> &get_range() const#

Get Sharpening Range.

sharpening intensity range 0~2 from low to high

See also

set_range()

Returns:

const std::vector<double> & Sharpening Range

ImageAugSharpen &set_range(const std::vector<double> &range)#

Set Sharpening Range with std::vector<double> value.

sharpening intensity range 0~2 from low to high

See also

get_range()

Parameters:

range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugSharpen& the reference of this object.

bool range_contains(double value) const#

Check if the Sharpening Range contains the value.

Returns:

bool true if the Sharpening Range contains the value, otherwise false.

double get_range_left() const#

Get left point value of Sharpening Range.

Returns:

const std::vector<double> & left point value of Sharpening Range

double get_range_right() const#

Get the right point value of Sharpening Range.

See also

set_range_left()

Returns:

const std::vector<double> & the right point value of Sharpening Range

ImageAugSharpen &set_range_left(double range_left)#

Set left point value of Sharpening Range with std::vector<double> value.

sharpening intensity range 0~2 from low to high

See also

get_range_left()

Parameters:

range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugSharpen& the reference of this object.

ImageAugSharpen &set_range_right(double range_right)#

Set the right point value of Sharpening Range with std::vector<double> value.

sharpening intensity range 0~2 from low to high

Parameters:

range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugSharpen& the reference of this object.

class ImageAugmentation : public aidi::param::ISchemable#

ImageAugmentation Parameter class generated by jinja2 automatically.

Image Augmentation Parameters Group.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const ImageAugBrightness &get_brightness() const#

Get Illumination Augmentation.

Illumination augmentation parameters

See also

set_brightness()

Returns:

const ImageAugBrightness & Illumination Augmentation

ImageAugmentation &set_brightness(const ImageAugBrightness &brightness)#

Set Illumination Augmentation with ImageAugBrightness value.

Illumination augmentation parameters

See also

get_brightness()

Parameters:

brightness – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugmentation& the reference of this object.

ImageAugBrightness &get_brightness()#

Get mutable reference of Illumination Augmentation.

Illumination augmentation parameters

Returns:

ImageAugmentation& the mutable reference of the group.

const ImageAugContrast &get_contrast() const#

Get Contrast Augmentation.

Contrast augmentation parameters

See also

set_contrast()

Returns:

const ImageAugContrast & Contrast Augmentation

ImageAugmentation &set_contrast(const ImageAugContrast &contrast)#

Set Contrast Augmentation with ImageAugContrast value.

Contrast augmentation parameters

See also

get_contrast()

Parameters:

contrast – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugmentation& the reference of this object.

ImageAugContrast &get_contrast()#

Get mutable reference of Contrast Augmentation.

Contrast augmentation parameters

Returns:

ImageAugmentation& the mutable reference of the group.

const ImageAugNoise &get_noise() const#

Get Noise Augmentation.

Noise augmentation parameters

See also

set_noise()

Returns:

const ImageAugNoise & Noise Augmentation

ImageAugmentation &set_noise(const ImageAugNoise &noise)#

Set Noise Augmentation with ImageAugNoise value.

Noise augmentation parameters

See also

get_noise()

Parameters:

noise – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugmentation& the reference of this object.

ImageAugNoise &get_noise()#

Get mutable reference of Noise Augmentation.

Noise augmentation parameters

Returns:

ImageAugmentation& the mutable reference of the group.

const ImageAugBlur &get_blur() const#

Get Blur.

Blur augmentation parameters

See also

set_blur()

Returns:

const ImageAugBlur & Blur

ImageAugmentation &set_blur(const ImageAugBlur &blur)#

Set Blur with ImageAugBlur value.

Blur augmentation parameters

See also

get_blur()

Parameters:

blur – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugmentation& the reference of this object.

ImageAugBlur &get_blur()#

Get mutable reference of Blur.

Blur augmentation parameters

Returns:

ImageAugmentation& the mutable reference of the group.

const ImageAugColorFilter &get_color_filter() const#

Get Color Filter.

Color filter augmentation parameters

Returns:

const ImageAugColorFilter & Color Filter

ImageAugmentation &set_color_filter(const ImageAugColorFilter &color_filter)#

Set Color Filter with ImageAugColorFilter value.

Color filter augmentation parameters

Parameters:

color_filter – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugmentation& the reference of this object.

ImageAugColorFilter &get_color_filter()#

Get mutable reference of Color Filter.

Color filter augmentation parameters

Returns:

ImageAugmentation& the mutable reference of the group.

const ImageAugIllumGradient &get_illum_gradient() const#

Get Illumination Gradient.

Illumination gradient augmentation parameters

Returns:

const ImageAugIllumGradient & Illumination Gradient

ImageAugmentation &set_illum_gradient(const ImageAugIllumGradient &illum_gradient)#

Set Illumination Gradient with ImageAugIllumGradient value.

Illumination gradient augmentation parameters

Parameters:

illum_gradient – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugmentation& the reference of this object.

ImageAugIllumGradient &get_illum_gradient()#

Get mutable reference of Illumination Gradient.

Illumination gradient augmentation parameters

Returns:

ImageAugmentation& the mutable reference of the group.

const ImageAugSharpen &get_sharpen() const#

Get Sharpening.

Sharpening augmentation parameters

See also

set_sharpen()

Returns:

const ImageAugSharpen & Sharpening

ImageAugmentation &set_sharpen(const ImageAugSharpen &sharpen)#

Set Sharpening with ImageAugSharpen value.

Sharpening augmentation parameters

See also

get_sharpen()

Parameters:

sharpen – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageAugmentation& the reference of this object.

ImageAugSharpen &get_sharpen()#

Get mutable reference of Sharpening.

Sharpening augmentation parameters

Returns:

ImageAugmentation& the mutable reference of the group.

class ImageEnhancementLEP : public aidi::param::ISchemable#

ImageEnhancementLEP Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Image Enhancement.

Use Augmented Images for Training and Processing

See also

set_enable()

Returns:

bool Enable Image Enhancement

ImageEnhancementLEP &set_enable(bool enable)#

Set Enable Image Enhancement with bool value.

Use Augmented Images for Training and Processing

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

int get_detail_feat_size() const#

Get Fine Texture Feature Size.

The size of the fine texture expected to be retained, the larger the value, the more detail areas are retained

Returns:

int Fine Texture Feature Size

ImageEnhancementLEP &set_detail_feat_size(int detail_feat_size)#

Set Fine Texture Feature Size with int value.

The size of the fine texture expected to be retained, the larger the value, the more detail areas are retained

Parameters:

detail_feat_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

int get_rough_feat_size() const#

Get Coarse Texture Feature Size.

The size of the coarse texture expected to be retained, the larger the value, the more detail areas are retained

Returns:

int Coarse Texture Feature Size

ImageEnhancementLEP &set_rough_feat_size(int rough_feat_size)#

Set Coarse Texture Feature Size with int value.

The size of the coarse texture expected to be retained, the larger the value, the more detail areas are retained

Parameters:

rough_feat_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

double get_detail_enhance_scale() const#

Get Fine Texture Enhancement Scale.

Fine Texture Enhancement Parameter, the larger the value, the more detail will be retained

Returns:

double Fine Texture Enhancement Scale

ImageEnhancementLEP &set_detail_enhance_scale(double detail_enhance_scale)#

Set Fine Texture Enhancement Scale with double value.

Fine Texture Enhancement Parameter, the larger the value, the more detail will be retained

Parameters:

detail_enhance_scale – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

double get_rough_enhance_scale() const#

Get Coarse Texture Enhancement Scale.

Coarse Texture Enhancement Parameter, the larger the value, the more detail will be retained

Returns:

double Coarse Texture Enhancement Scale

ImageEnhancementLEP &set_rough_enhance_scale(double rough_enhance_scale)#

Set Coarse Texture Enhancement Scale with double value.

Coarse Texture Enhancement Parameter, the larger the value, the more detail will be retained

Parameters:

rough_enhance_scale – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

double get_base_keep_ratio() const#

Get Original Image Retaining Ratio.

Original image retaining ratio, the larger the value, the more non-details will be retained, details will not be affected

Returns:

double Original Image Retaining Ratio

ImageEnhancementLEP &set_base_keep_ratio(double base_keep_ratio)#

Set Original Image Retaining Ratio with double value.

Original image retaining ratio, the larger the value, the more non-details will be retained, details will not be affected

Parameters:

base_keep_ratio – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

int get_clip_type() const#

Get Pixel Preservation Mode.

Truncating according to the cumulative distribution ratio of pixel values or the effective range ratio, and saturating and truncating pixel values that exceed the reserved ratio

See also

set_clip_type()

Returns:

int Pixel Preservation Mode

ImageEnhancementLEP &set_clip_type(int clip_type)#

Set Pixel Preservation Mode with int value.

Truncating according to the cumulative distribution ratio of pixel values or the effective range ratio, and saturating and truncating pixel values that exceed the reserved ratio

See also

get_clip_type()

Parameters:

clip_type – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

const std::vector<double> &get_keep_range() const#

Get Pixel Preservation Ratio.

According to the cumulative distribution of the value, the proportion range is reserved. If it is based on the value range, the pixel reserve ratio * the image maximum value domain range.Exp: 8 Bit image will be multiplied by 255

See also

set_keep_range()

Returns:

const std::vector<double> & Pixel Preservation Ratio

ImageEnhancementLEP &set_keep_range(const std::vector<double> &keep_range)#

Set Pixel Preservation Ratio with std::vector<double> value.

According to the cumulative distribution of the value, the proportion range is reserved. If it is based on the value range, the pixel reserve ratio * the image maximum value domain range.Exp: 8 Bit image will be multiplied by 255

See also

get_keep_range()

Parameters:

keep_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

bool keep_range_contains(double value) const#

Check if the Pixel Preservation Ratio contains the value.

Returns:

bool true if the Pixel Preservation Ratio contains the value, otherwise false.

double get_keep_range_left() const#

Get left point value of Pixel Preservation Ratio.

Returns:

const std::vector<double> & left point value of Pixel Preservation Ratio

double get_keep_range_right() const#

Get the right point value of Pixel Preservation Ratio.

Returns:

const std::vector<double> & the right point value of Pixel Preservation Ratio

ImageEnhancementLEP &set_keep_range_left(double keep_range_left)#

Set left point value of Pixel Preservation Ratio with std::vector<double> value.

According to the cumulative distribution of the value, the proportion range is reserved. If it is based on the value range, the pixel reserve ratio * the image maximum value domain range.Exp: 8 Bit image will be multiplied by 255

Parameters:

keep_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

ImageEnhancementLEP &set_keep_range_right(double keep_range_right)#

Set the right point value of Pixel Preservation Ratio with std::vector<double> value.

According to the cumulative distribution of the value, the proportion range is reserved. If it is based on the value range, the pixel reserve ratio * the image maximum value domain range.Exp: 8 Bit image will be multiplied by 255

Parameters:

keep_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ImageEnhancementLEP& the reference of this object.

class DataAugmentation : public aidi::param::ISchemable#

DataAugmentation Parameter class generated by jinja2 automatically.

Data Augmentation Parameters Group.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const GeometryAugmentation &get_geometry_aumentation() const#

Get Geometry Augmentation.

Geometry augmentation parameters

Returns:

const GeometryAugmentation & Geometry Augmentation

DataAugmentation &set_geometry_aumentation(const GeometryAugmentation &geometry_aumentation)#

Set Geometry Augmentation with GeometryAugmentation value.

Geometry augmentation parameters

Parameters:

geometry_aumentation – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DataAugmentation& the reference of this object.

GeometryAugmentation &get_geometry_aumentation()#

Get mutable reference of Geometry Augmentation.

Geometry augmentation parameters

Returns:

DataAugmentation& the mutable reference of the group.

const ImageAugmentation &get_image_augmentation() const#

Get Image Augmentation.

Image augmentation parameters

Returns:

const ImageAugmentation & Image Augmentation

DataAugmentation &set_image_augmentation(const ImageAugmentation &image_augmentation)#

Set Image Augmentation with ImageAugmentation value.

Image augmentation parameters

Parameters:

image_augmentation – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DataAugmentation& the reference of this object.

ImageAugmentation &get_image_augmentation()#

Get mutable reference of Image Augmentation.

Image augmentation parameters

Returns:

DataAugmentation& the mutable reference of the group.

const ImageEnhancementLEP &get_image_enhancement() const#

Get Image Enhancement.

Image enhancement parameters

Returns:

const ImageEnhancementLEP & Image Enhancement

DataAugmentation &set_image_enhancement(const ImageEnhancementLEP &image_enhancement)#

Set Image Enhancement with ImageEnhancementLEP value.

Image enhancement parameters

Parameters:

image_enhancement – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DataAugmentation& the reference of this object.

ImageEnhancementLEP &get_image_enhancement()#

Get mutable reference of Image Enhancement.

Image enhancement parameters

Returns:

DataAugmentation& the mutable reference of the group.

Segmentation Training Parameters#

class SegmentationInputShape : public aidi::param::ISchemable#

SegmentationInputShape Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Custom Input Shape.

Enable to Customize Network Input Shape

See also

set_enable()

Returns:

bool Enable Custom Input Shape

SegmentationInputShape &set_enable(bool enable)#

Set Enable Custom Input Shape with bool value.

Enable to Customize Network Input Shape

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationInputShape& the reference of this object.

int get_base_input_width() const#

Get Base Input Width.

Base Input Width

Returns:

int Base Input Width

SegmentationInputShape &set_base_input_width(int base_input_width)#

Set Base Input Width with int value.

Base Input Width

Parameters:

base_input_width – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationInputShape& the reference of this object.

int get_base_input_height() const#

Get Base Input Height.

Base Input Height

Returns:

int Base Input Height

SegmentationInputShape &set_base_input_height(int base_input_height)#

Set Base Input Height with int value.

Base Input Height

Parameters:

base_input_height – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationInputShape& the reference of this object.

enum aidi::param::ImageSplitMode#

Values:

enumerator kAuto = 0#
enumerator kManual = 1#
class SegmentationImageSplit : public aidi::param::ISchemable#

SegmentationImageSplit Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const ImageSplitMode &get_split_set_method() const#

Get Split Method.

kAuto : The algorithm adapts the recommended resolution levelkManual according to the original map size and minimum marking size: the resolution level is based on manual setting view : The actual resolution level can be viewed in Help-View log. Br/>Brief description of algorithm : The algorithm scales the short edge of the image to 256*resolution level before feeding to the network, and the long edge scales equally to the input network.

Returns:

const ImageSplitMode & Split Method

SegmentationImageSplit &set_split_set_method(const ImageSplitMode &split_set_method)#

Set Split Method with ImageSplitMode value.

kAuto : The algorithm adapts the recommended resolution levelkManual according to the original map size and minimum marking size: the resolution level is based on manual setting view : The actual resolution level can be viewed in Help-View log. Br/>Brief description of algorithm : The algorithm scales the short edge of the image to 256*resolution level before feeding to the network, and the long edge scales equally to the input network.

Parameters:

split_set_method – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationImageSplit& the reference of this object.

int get_max_split() const#

Get Resolution Level.

The short side of the image input will be scaled to (base_size*Resolution Level), and the long side will be scaled proportionally. When the max precision set is higher than the required precision of the algorithm, the precision will be automatically reduced. The applied precision can be acquired from figuration files of the trained model

See also

set_max_split()

Returns:

int Resolution Level

SegmentationImageSplit &set_max_split(int max_split)#

Set Resolution Level with int value.

The short side of the image input will be scaled to (base_size*Resolution Level), and the long side will be scaled proportionally. When the max precision set is higher than the required precision of the algorithm, the precision will be automatically reduced. The applied precision can be acquired from figuration files of the trained model

See also

get_max_split()

Parameters:

max_split – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationImageSplit& the reference of this object.

class SegmentationModelParameters : public aidi::param::ISchemable#

SegmentationModelParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const std::string &get_model_arch() const#

Get Model Architecture.

The ‘Small Defects’ model has better detection effect on small defects, and the ‘Comprehensive Model’ model has better comprehensive effect. Recommended to use the ‘Comprehensive Model’ model when the detection effect of the Small Defects model is poor. ‘Contrastive Model’ is only for contrastive segmetation

See also

set_model_arch()

Returns:

const std::string & Model Architecture

SegmentationModelParameters &set_model_arch(const std::string &model_arch)#

Set Model Architecture with std::string value.

The ‘Small Defects’ model has better detection effect on small defects, and the ‘Comprehensive Model’ model has better comprehensive effect. Recommended to use the ‘Comprehensive Model’ model when the detection effect of the Small Defects model is poor. ‘Contrastive Model’ is only for contrastive segmetation

See also

get_model_arch()

Parameters:

model_arch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationModelParameters& the reference of this object.

bool get_shift_stable() const#

Get With Shift Stable.

With shift stable, the adaptability of the model to the slight shift of the target can be improved, but the training and inference speed will be 20 percent slower

Returns:

bool With Shift Stable

SegmentationModelParameters &set_shift_stable(bool shift_stable)#

Set With Shift Stable with bool value.

With shift stable, the adaptability of the model to the slight shift of the target can be improved, but the training and inference speed will be 20 percent slower

Parameters:

shift_stable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationModelParameters& the reference of this object.

class SegmentationTrainingSampleStrategy : public aidi::param::ISchemable#

SegmentationTrainingSampleStrategy Parameter class generated by jinja2 automatically.

Segmentation training parameters to control the the input data.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

double get_hard_case_rate() const#

Get Sample Rate of Hard Case.

The larger the value set, the higher the attention to the hard case

Returns:

double Sample Rate of Hard Case

SegmentationTrainingSampleStrategy &set_hard_case_rate(double hard_case_rate)#

Set Sample Rate of Hard Case with double value.

The larger the value set, the higher the attention to the hard case

Parameters:

hard_case_rate – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationTrainingSampleStrategy& the reference of this object.

int get_hard_case_split() const#

Get Hard Case Split.

Number of hard case discrete coodinates, Default value is recommended.

Returns:

int Hard Case Split

SegmentationTrainingSampleStrategy &set_hard_case_split(int hard_case_split)#

Set Hard Case Split with int value.

Number of hard case discrete coodinates, Default value is recommended.

Parameters:

hard_case_split – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationTrainingSampleStrategy& the reference of this object.

const SegmentationImageSplit &get_image_split() const#

Get Image Split.

Image Split Parameters

Returns:

const SegmentationImageSplit & Image Split

SegmentationTrainingSampleStrategy &set_image_split(const SegmentationImageSplit &image_split)#

Set Image Split with SegmentationImageSplit value.

Image Split Parameters

Parameters:

image_split – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationTrainingSampleStrategy& the reference of this object.

SegmentationImageSplit &get_image_split()#

Get mutable reference of Image Split.

Image Split Parameters

Returns:

SegmentationTrainingSampleStrategy& the mutable reference of the group.

const SegmentationInputShape &get_input_shape() const#

Get Input Shape.

Input Shape Parameters

Returns:

const SegmentationInputShape & Input Shape

SegmentationTrainingSampleStrategy &set_input_shape(const SegmentationInputShape &input_shape)#

Set Input Shape with SegmentationInputShape value.

Input Shape Parameters

Parameters:

input_shape – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationTrainingSampleStrategy& the reference of this object.

SegmentationInputShape &get_input_shape()#

Get mutable reference of Input Shape.

Input Shape Parameters

Returns:

SegmentationTrainingSampleStrategy& the mutable reference of the group.

class SegmentationTrainingParameters : public aidi::param::SchemableParameter#

SegmentationTrainingParameters Parameter class generated by jinja2 automatically.

Segmentation Training Parameters Group.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_epoch() const#

Get Epoch.

Number of epochs to train

See also

set_epoch()

Returns:

int Epoch

SegmentationTrainingParameters &set_epoch(int epoch)#

Set Epoch with int value.

Number of epochs to train

See also

get_epoch()

Parameters:

epoch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationTrainingParameters& the reference of this object.

int get_batch_size() const#

Get Training Batch Size.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

set_batch_size()

Returns:

int Training Batch Size

SegmentationTrainingParameters &set_batch_size(int batch_size)#

Set Training Batch Size with int value.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

get_batch_size()

Parameters:

batch_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationTrainingParameters& the reference of this object.

const SegmentationTrainingSampleStrategy &get_sampling_strategy() const#

Get Sampling Strategy.

Sampling Strategy Parameters

Returns:

const SegmentationTrainingSampleStrategy & Sampling Strategy

SegmentationTrainingParameters &set_sampling_strategy(const SegmentationTrainingSampleStrategy &sampling_strategy)#

Set Sampling Strategy with SegmentationTrainingSampleStrategy value.

Sampling Strategy Parameters

Parameters:

sampling_strategy – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationTrainingParameters& the reference of this object.

SegmentationTrainingSampleStrategy &get_sampling_strategy()#

Get mutable reference of Sampling Strategy.

Sampling Strategy Parameters

Returns:

SegmentationTrainingParameters& the mutable reference of the group.

const SegmentationModelParameters &get_model_param() const#

Get Model Parameters.

Select the appropriate basic model according to different detection targets and speed requirements

Returns:

const SegmentationModelParameters & Model Parameters

SegmentationTrainingParameters &set_model_param(const SegmentationModelParameters &model_param)#

Set Model Parameters with SegmentationModelParameters value.

Select the appropriate basic model according to different detection targets and speed requirements

Parameters:

model_param – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationTrainingParameters& the reference of this object.

SegmentationModelParameters &get_model_param()#

Get mutable reference of Model Parameters.

Select the appropriate basic model according to different detection targets and speed requirements

Returns:

SegmentationTrainingParameters& the mutable reference of the group.

const DataAugmentation &get_augmentations() const#

Get Data Augmentation.

Data Augmentation Parameters

Returns:

const DataAugmentation & Data Augmentation

SegmentationTrainingParameters &set_augmentations(const DataAugmentation &augmentations)#

Set Data Augmentation with DataAugmentation value.

Data Augmentation Parameters

Parameters:

augmentations – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SegmentationTrainingParameters& the reference of this object.

DataAugmentation &get_augmentations()#

Get mutable reference of Data Augmentation.

Data Augmentation Parameters

Returns:

SegmentationTrainingParameters& the mutable reference of the group.

class BinaryTrainingParameters : public aidi::param::IParameter#

Parameter class to store some binary configuration information that the parameter generator can not represent for the model trainer.

Public Functions

BinaryTrainingParameters &set_global_mask(const geometry::MultiPolygon2f &masks)#

Set the global mask. Each sub image in the training views will be masked with the image mean values before training.

Parameters:

masks – The mask polygons.

Returns:

BinaryTrainingParameters& The parameter instance.

const geometry::MultiPolygon2f &get_global_mask() const#

Get the global mask.

Returns:

const geometry::MultiPolygon2f& The global mask polygons

Unsuper Segmentation Training Parameters#

class UnsuperSegmentationInputShape : public aidi::param::ISchemable#

UnsuperSegmentationInputShape Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Custom Sampling Shape.

Enable to Customize Network Sampling Input Shape

See also

set_enable()

Returns:

bool Enable Custom Sampling Shape

UnsuperSegmentationInputShape &set_enable(bool enable)#

Set Enable Custom Sampling Shape with bool value.

Enable to Customize Network Sampling Input Shape

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationInputShape& the reference of this object.

int get_sampling_width() const#

Get Sampling Input Width.

Sampling Input Width

Returns:

int Sampling Input Width

UnsuperSegmentationInputShape &set_sampling_width(int sampling_width)#

Set Sampling Input Width with int value.

Sampling Input Width

Parameters:

sampling_width – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationInputShape& the reference of this object.

int get_sampling_height() const#

Get Sampling Input Height.

Sampling Input Height

Returns:

int Sampling Input Height

UnsuperSegmentationInputShape &set_sampling_height(int sampling_height)#

Set Sampling Input Height with int value.

Sampling Input Height

Parameters:

sampling_height – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationInputShape& the reference of this object.

class UnsuperSegmentationTrainingParameters : public aidi::param::SchemableParameter#

UnsuperSegmentationTrainingParameters Parameter class generated by jinja2 automatically.

Unsuper Segmentation Training Parameters Group.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_epoch() const#

Get Epochs.

Number of epochs to train

See also

set_epoch()

Returns:

int Epochs

UnsuperSegmentationTrainingParameters &set_epoch(int epoch)#

Set Epochs with int value.

Number of epochs to train

See also

get_epoch()

Parameters:

epoch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationTrainingParameters& the reference of this object.

int get_batch_size() const#

Get Batch Size.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

set_batch_size()

Returns:

int Batch Size

UnsuperSegmentationTrainingParameters &set_batch_size(int batch_size)#

Set Batch Size with int value.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

get_batch_size()

Parameters:

batch_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationTrainingParameters& the reference of this object.

const UnsuperSegmentationSamplingParameters &get_sampling_strategy() const#

Get Sampling Strategy.

Sampling Parameters

Returns:

const UnsuperSegmentationSamplingParameters & Sampling Strategy

UnsuperSegmentationTrainingParameters &set_sampling_strategy(const UnsuperSegmentationSamplingParameters &sampling_strategy)#

Set Sampling Strategy with UnsuperSegmentationSamplingParameters value.

Sampling Parameters

Parameters:

sampling_strategy – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationTrainingParameters& the reference of this object.

UnsuperSegmentationSamplingParameters &get_sampling_strategy()#

Get mutable reference of Sampling Strategy.

Sampling Parameters

Returns:

UnsuperSegmentationTrainingParameters& the mutable reference of the group.

const UnsuperSegmentationModelParameters &get_model_param() const#

Get Model Parameters.

Model Parameters

Returns:

const UnsuperSegmentationModelParameters & Model Parameters

UnsuperSegmentationTrainingParameters &set_model_param(const UnsuperSegmentationModelParameters &model_param)#

Set Model Parameters with UnsuperSegmentationModelParameters value.

Model Parameters

Parameters:

model_param – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationTrainingParameters& the reference of this object.

UnsuperSegmentationModelParameters &get_model_param()#

Get mutable reference of Model Parameters.

Model Parameters

Returns:

UnsuperSegmentationTrainingParameters& the mutable reference of the group.

const DataAugmentation &get_augmentations() const#

Get Data Augmentation.

Data Augmentation Parameters

Returns:

const DataAugmentation & Data Augmentation

UnsuperSegmentationTrainingParameters &set_augmentations(const DataAugmentation &augmentations)#

Set Data Augmentation with DataAugmentation value.

Data Augmentation Parameters

Parameters:

augmentations – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationTrainingParameters& the reference of this object.

DataAugmentation &get_augmentations()#

Get mutable reference of Data Augmentation.

Data Augmentation Parameters

Returns:

UnsuperSegmentationTrainingParameters& the mutable reference of the group.

class UnsuperSegmentationSamplingParameters : public aidi::param::ISchemable#

UnsuperSegmentationSamplingParameters Parameter class generated by jinja2 automatically.

Unsuper Segmentation Training Sample Parameters Group.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const UnsuperSegmentationInputShape &get_sampling_input_shape() const#

Get Input Shape.

Input Sampling Shape Parameters

Returns:

const UnsuperSegmentationInputShape & Input Shape

UnsuperSegmentationSamplingParameters &set_sampling_input_shape(const UnsuperSegmentationInputShape &sampling_input_shape)#

Set Input Shape with UnsuperSegmentationInputShape value.

Input Sampling Shape Parameters

Parameters:

sampling_input_shape – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationSamplingParameters& the reference of this object.

UnsuperSegmentationInputShape &get_sampling_input_shape()#

Get mutable reference of Input Shape.

Input Sampling Shape Parameters

Returns:

UnsuperSegmentationSamplingParameters& the mutable reference of the group.

bool get_local_sampling() const#

Get Local Sampling Strategy.

when enable : Crop a patch(Input Shape) of image to train instead of whole image, incresing train speed but might make perfomance decline when image is complex

Returns:

bool Local Sampling Strategy

UnsuperSegmentationSamplingParameters &set_local_sampling(bool local_sampling)#

Set Local Sampling Strategy with bool value.

when enable : Crop a patch(Input Shape) of image to train instead of whole image, incresing train speed but might make perfomance decline when image is complex

Parameters:

local_sampling – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationSamplingParameters& the reference of this object.

int get_sampling_resolution() const#

Get Sampling Resolution Level.

The short side of the image input will be scaled to (Sampling Input Size * Sampling Resolution), and the long side will be scaled proportionally.

Returns:

int Sampling Resolution Level

UnsuperSegmentationSamplingParameters &set_sampling_resolution(int sampling_resolution)#

Set Sampling Resolution Level with int value.

The short side of the image input will be scaled to (Sampling Input Size * Sampling Resolution), and the long side will be scaled proportionally.

Parameters:

sampling_resolution – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationSamplingParameters& the reference of this object.

bool get_image_consistant_optimize() const#

Get High Consistant Image.

enable when image looks like the same in all region, such as texture image, it helps speed up train and might get better performance in such kind of image

Returns:

bool High Consistant Image

UnsuperSegmentationSamplingParameters &set_image_consistant_optimize(bool image_consistant_optimize)#

Set High Consistant Image with bool value.

enable when image looks like the same in all region, such as texture image, it helps speed up train and might get better performance in such kind of image

Parameters:

image_consistant_optimize – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationSamplingParameters& the reference of this object.

class UnsuperSegmentationModelParameters : public aidi::param::ISchemable#

UnsuperSegmentationModelParameters Parameter class generated by jinja2 automatically.

Unsuper Segmentation Model Parameters Group.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const std::string &get_model_arch() const#

Get Model Architecture.

General Model traning slow but get better result, using for complex image; Training Fast Model training fast but might get worse performance than General Model

See also

set_model_arch()

Returns:

const std::string & Model Architecture

UnsuperSegmentationModelParameters &set_model_arch(const std::string &model_arch)#

Set Model Architecture with std::string value.

General Model traning slow but get better result, using for complex image; Training Fast Model training fast but might get worse performance than General Model

See also

get_model_arch()

Parameters:

model_arch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationModelParameters& the reference of this object.

bool get_add_logical_model() const#

Get Logical Defect Detect.

increase detect performance for logical defect,such as character lost or duplicate, but increasing training and infering speed

Returns:

bool Logical Defect Detect

UnsuperSegmentationModelParameters &set_add_logical_model(bool add_logical_model)#

Set Logical Defect Detect with bool value.

increase detect performance for logical defect,such as character lost or duplicate, but increasing training and infering speed

Parameters:

add_logical_model – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationModelParameters& the reference of this object.

Unsuper Classification Training Parameters#

class UnsuperClassificationInputShape : public aidi::param::ISchemable#

UnsuperClassificationInputShape Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Custom Input Shape.

Enable to Customize Network Input Shape

See also

set_enable()

Returns:

bool Enable Custom Input Shape

UnsuperClassificationInputShape &set_enable(bool enable)#

Set Enable Custom Input Shape with bool value.

Enable to Customize Network Input Shape

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationInputShape& the reference of this object.

int get_base_input_width() const#

Get Base Input Width.

Base Input Width

Returns:

int Base Input Width

UnsuperClassificationInputShape &set_base_input_width(int base_input_width)#

Set Base Input Width with int value.

Base Input Width

Parameters:

base_input_width – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationInputShape& the reference of this object.

int get_base_input_height() const#

Get Base Input Height.

Base Input Height

Returns:

int Base Input Height

UnsuperClassificationInputShape &set_base_input_height(int base_input_height)#

Set Base Input Height with int value.

Base Input Height

Parameters:

base_input_height – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationInputShape& the reference of this object.

class UnsuperClassificationTrainingParameters : public aidi::param::SchemableParameter#

UnsuperClassificationTrainingParameters Parameter class generated by jinja2 automatically.

Unsuper Classification Training Parameters Group.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_epoch() const#

Get Epoch.

Number of epochs to train

See also

set_epoch()

Returns:

int Epoch

UnsuperClassificationTrainingParameters &set_epoch(int epoch)#

Set Epoch with int value.

Number of epochs to train

See also

get_epoch()

Parameters:

epoch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationTrainingParameters& the reference of this object.

int get_batch_size() const#

Get Training Batch Size.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

set_batch_size()

Returns:

int Training Batch Size

UnsuperClassificationTrainingParameters &set_batch_size(int batch_size)#

Set Training Batch Size with int value.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

get_batch_size()

Parameters:

batch_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationTrainingParameters& the reference of this object.

const UnsuperClassificationInputShape &get_input_shape() const#

Get Input Shape.

Input Shape Parameters

Returns:

const UnsuperClassificationInputShape & Input Shape

UnsuperClassificationTrainingParameters &set_input_shape(const UnsuperClassificationInputShape &input_shape)#

Set Input Shape with UnsuperClassificationInputShape value.

Input Shape Parameters

Parameters:

input_shape – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationTrainingParameters& the reference of this object.

UnsuperClassificationInputShape &get_input_shape()#

Get mutable reference of Input Shape.

Input Shape Parameters

Returns:

UnsuperClassificationTrainingParameters& the mutable reference of the group.

const std::string &get_model_arch() const#

Get Model Architecture.

Currently only one baseline model

See also

set_model_arch()

Returns:

const std::string & Model Architecture

UnsuperClassificationTrainingParameters &set_model_arch(const std::string &model_arch)#

Set Model Architecture with std::string value.

Currently only one baseline model

See also

get_model_arch()

Parameters:

model_arch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationTrainingParameters& the reference of this object.

const DataAugmentation &get_augmentations() const#

Get Data Augmentation.

Data Augmentation Parameters

Returns:

const DataAugmentation & Data Augmentation

UnsuperClassificationTrainingParameters &set_augmentations(const DataAugmentation &augmentations)#

Set Data Augmentation with DataAugmentation value.

Data Augmentation Parameters

Parameters:

augmentations – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationTrainingParameters& the reference of this object.

DataAugmentation &get_augmentations()#

Get mutable reference of Data Augmentation.

Data Augmentation Parameters

Returns:

UnsuperClassificationTrainingParameters& the mutable reference of the group.

Unsuper Segmentation Infering Parameters#

class UnsuperDefectRadius : public aidi::param::ISchemable#

UnsuperDefectRadius Parameter class generated by jinja2 automatically.

Parameters using for define defect size

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_auto_set() const#

Get Automatic Setting.

Network adjust defect radius automaticly

See also

set_auto_set()

Returns:

bool Automatic Setting

UnsuperDefectRadius &set_auto_set(bool auto_set)#

Set Automatic Setting with bool value.

Network adjust defect radius automaticly

See also

get_auto_set()

Parameters:

auto_set – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperDefectRadius& the reference of this object.

int get_size() const#

Get Defect Radius.

defect size

See also

set_size()

Returns:

int Defect Radius

UnsuperDefectRadius &set_size(int size)#

Set Defect Radius with int value.

defect size

See also

get_size()

Parameters:

size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperDefectRadius& the reference of this object.

class UnsuperSegmentationInferingParameters : public aidi::param::SchemableParameter#

UnsuperSegmentationInferingParameters Parameter class generated by jinja2 automatically.

UnsuperSegmentationInferingParameters

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_minimum_defect_size() const#

Get Minimum Defect Size.

Minimun detect that customer want to detect, but too small will increase overkill

Returns:

int Minimum Defect Size

UnsuperSegmentationInferingParameters &set_minimum_defect_size(int minimum_defect_size)#

Set Minimum Defect Size with int value.

Minimun detect that customer want to detect, but too small will increase overkill

Parameters:

minimum_defect_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationInferingParameters& the reference of this object.

int get_sampling_density() const#

Get Sampling Density.

smaller value will make result more precise, but increae inference time

Returns:

int Sampling Density

UnsuperSegmentationInferingParameters &set_sampling_density(int sampling_density)#

Set Sampling Density with int value.

smaller value will make result more precise, but increae inference time

Parameters:

sampling_density – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperSegmentationInferingParameters& the reference of this object.

Unsuper Classification Infering Parameters#

class UnsuperClassificationInferingParameters : public aidi::param::SchemableParameter#

UnsuperClassificationInferingParameters Parameter class generated by jinja2 automatically.

Parameters using for unsuper classification inference

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

double get_ng_thresh() const#

Get Ng Thresh.

image will be set to ok when score < Ng Thresh, and set to ng when score > Ng Thresh

See also

set_ng_thresh()

Returns:

double Ng Thresh

UnsuperClassificationInferingParameters &set_ng_thresh(double ng_thresh)#

Set Ng Thresh with double value.

image will be set to ok when score < Ng Thresh, and set to ng when score > Ng Thresh

See also

get_ng_thresh()

Parameters:

ng_thresh – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationInferingParameters& the reference of this object.

const UnsuperDefectRadius &get_defect_radius() const#

Get Defect Radius.

Expected defect size

Returns:

const UnsuperDefectRadius & Defect Radius

UnsuperClassificationInferingParameters &set_defect_radius(const UnsuperDefectRadius &defect_radius)#

Set Defect Radius with UnsuperDefectRadius value.

Expected defect size

Parameters:

defect_radius – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

UnsuperClassificationInferingParameters& the reference of this object.

UnsuperDefectRadius &get_defect_radius()#

Get mutable reference of Defect Radius.

Expected defect size

Returns:

UnsuperClassificationInferingParameters& the mutable reference of the group.

Filter Parameters#

class AxialSideLengthRange : public aidi::param::ISchemable#

AxialSideLengthRange Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Axial Side Length Filter.

Enable this option to filter regions with axial side length.

See also

set_enable()

Returns:

bool Axial Side Length Filter

AxialSideLengthRange &set_enable(bool enable)#

Set Axial Side Length Filter with bool value.

Enable this option to filter regions with axial side length.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

const std::vector<int> &get_x_axis_side_range() const#

Get X-Axis Side Length Range.

The X-axis side length range of regions you want to keep.

Returns:

const std::vector<int> & X-Axis Side Length Range

AxialSideLengthRange &set_x_axis_side_range(const std::vector<int> &x_axis_side_range)#

Set X-Axis Side Length Range with std::vector<int> value.

The X-axis side length range of regions you want to keep.

Parameters:

x_axis_side_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

bool x_axis_side_range_contains(int value) const#

Check if the X-Axis Side Length Range contains the value.

Returns:

bool true if the X-Axis Side Length Range contains the value, otherwise false.

int get_x_axis_side_range_left() const#

Get left point value of X-Axis Side Length Range.

Returns:

const std::vector<int> & left point value of X-Axis Side Length Range

int get_x_axis_side_range_right() const#

Get the right point value of X-Axis Side Length Range.

Returns:

const std::vector<int> & the right point value of X-Axis Side Length Range

AxialSideLengthRange &set_x_axis_side_range_left(int x_axis_side_range_left)#

Set left point value of X-Axis Side Length Range with std::vector<int> value.

The X-axis side length range of regions you want to keep.

Parameters:

x_axis_side_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

AxialSideLengthRange &set_x_axis_side_range_right(int x_axis_side_range_right)#

Set the right point value of X-Axis Side Length Range with std::vector<int> value.

The X-axis side length range of regions you want to keep.

Parameters:

x_axis_side_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

const std::vector<int> &get_y_axis_side_range() const#

Get Y-Axis Side Length Range.

The Y-axis side length range of regions you want to keep.

Returns:

const std::vector<int> & Y-Axis Side Length Range

AxialSideLengthRange &set_y_axis_side_range(const std::vector<int> &y_axis_side_range)#

Set Y-Axis Side Length Range with std::vector<int> value.

The Y-axis side length range of regions you want to keep.

Parameters:

y_axis_side_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

bool y_axis_side_range_contains(int value) const#

Check if the Y-Axis Side Length Range contains the value.

Returns:

bool true if the Y-Axis Side Length Range contains the value, otherwise false.

int get_y_axis_side_range_left() const#

Get left point value of Y-Axis Side Length Range.

Returns:

const std::vector<int> & left point value of Y-Axis Side Length Range

int get_y_axis_side_range_right() const#

Get the right point value of Y-Axis Side Length Range.

Returns:

const std::vector<int> & the right point value of Y-Axis Side Length Range

AxialSideLengthRange &set_y_axis_side_range_left(int y_axis_side_range_left)#

Set left point value of Y-Axis Side Length Range with std::vector<int> value.

The Y-axis side length range of regions you want to keep.

Parameters:

y_axis_side_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

AxialSideLengthRange &set_y_axis_side_range_right(int y_axis_side_range_right)#

Set the right point value of Y-Axis Side Length Range with std::vector<int> value.

The Y-axis side length range of regions you want to keep.

Parameters:

y_axis_side_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

const std::vector<double> &get_x_y_ratio_range() const#

Get X/Y Ratio Range.

The range of the ratio of X-axis side length to the Y-axis side length of the regions that you want to keep.

Returns:

const std::vector<double> & X/Y Ratio Range

AxialSideLengthRange &set_x_y_ratio_range(const std::vector<double> &x_y_ratio_range)#

Set X/Y Ratio Range with std::vector<double> value.

The range of the ratio of X-axis side length to the Y-axis side length of the regions that you want to keep.

Parameters:

x_y_ratio_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

bool x_y_ratio_range_contains(double value) const#

Check if the X/Y Ratio Range contains the value.

Returns:

bool true if the X/Y Ratio Range contains the value, otherwise false.

double get_x_y_ratio_range_left() const#

Get left point value of X/Y Ratio Range.

Returns:

const std::vector<double> & left point value of X/Y Ratio Range

double get_x_y_ratio_range_right() const#

Get the right point value of X/Y Ratio Range.

Returns:

const std::vector<double> & the right point value of X/Y Ratio Range

AxialSideLengthRange &set_x_y_ratio_range_left(double x_y_ratio_range_left)#

Set left point value of X/Y Ratio Range with std::vector<double> value.

The range of the ratio of X-axis side length to the Y-axis side length of the regions that you want to keep.

Parameters:

x_y_ratio_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

AxialSideLengthRange &set_x_y_ratio_range_right(double x_y_ratio_range_right)#

Set the right point value of X/Y Ratio Range with std::vector<double> value.

The range of the ratio of X-axis side length to the Y-axis side length of the regions that you want to keep.

Parameters:

x_y_ratio_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AxialSideLengthRange& the reference of this object.

class SideLengthRange : public aidi::param::ISchemable#

SideLengthRange Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Side Length Filter.

Enable this option to filter regions with long side length and short side length.

See also

set_enable()

Returns:

bool Side Length Filter

SideLengthRange &set_enable(bool enable)#

Set Side Length Filter with bool value.

Enable this option to filter regions with long side length and short side length.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

bool get_on_rotate_rect() const#

Get Filter On Min-Area-Rect.

The “Longer Side Length Range” and “Shorter Side Length Range” will be applied to the min-area rotate rectangle of each region if this option is enabled, otherwise, they will be applied to the axial bounding rect.

Returns:

bool Filter On Min-Area-Rect

SideLengthRange &set_on_rotate_rect(bool on_rotate_rect)#

Set Filter On Min-Area-Rect with bool value.

The “Longer Side Length Range” and “Shorter Side Length Range” will be applied to the min-area rotate rectangle of each region if this option is enabled, otherwise, they will be applied to the axial bounding rect.

Parameters:

on_rotate_rect – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

const std::vector<int> &get_longer_side_range() const#

Get Longer Side Length Range.

The longer side length range of regions you want to keep.

Returns:

const std::vector<int> & Longer Side Length Range

SideLengthRange &set_longer_side_range(const std::vector<int> &longer_side_range)#

Set Longer Side Length Range with std::vector<int> value.

The longer side length range of regions you want to keep.

Parameters:

longer_side_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

bool longer_side_range_contains(int value) const#

Check if the Longer Side Length Range contains the value.

Returns:

bool true if the Longer Side Length Range contains the value, otherwise false.

int get_longer_side_range_left() const#

Get left point value of Longer Side Length Range.

Returns:

const std::vector<int> & left point value of Longer Side Length Range

int get_longer_side_range_right() const#

Get the right point value of Longer Side Length Range.

Returns:

const std::vector<int> & the right point value of Longer Side Length Range

SideLengthRange &set_longer_side_range_left(int longer_side_range_left)#

Set left point value of Longer Side Length Range with std::vector<int> value.

The longer side length range of regions you want to keep.

Parameters:

longer_side_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

SideLengthRange &set_longer_side_range_right(int longer_side_range_right)#

Set the right point value of Longer Side Length Range with std::vector<int> value.

The longer side length range of regions you want to keep.

Parameters:

longer_side_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

const std::vector<int> &get_shorter_side_range() const#

Get Shorter Side Length Range.

The shorter side length range of regions you want to keep.

Returns:

const std::vector<int> & Shorter Side Length Range

SideLengthRange &set_shorter_side_range(const std::vector<int> &shorter_side_range)#

Set Shorter Side Length Range with std::vector<int> value.

The shorter side length range of regions you want to keep.

Parameters:

shorter_side_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

bool shorter_side_range_contains(int value) const#

Check if the Shorter Side Length Range contains the value.

Returns:

bool true if the Shorter Side Length Range contains the value, otherwise false.

int get_shorter_side_range_left() const#

Get left point value of Shorter Side Length Range.

Returns:

const std::vector<int> & left point value of Shorter Side Length Range

int get_shorter_side_range_right() const#

Get the right point value of Shorter Side Length Range.

Returns:

const std::vector<int> & the right point value of Shorter Side Length Range

SideLengthRange &set_shorter_side_range_left(int shorter_side_range_left)#

Set left point value of Shorter Side Length Range with std::vector<int> value.

The shorter side length range of regions you want to keep.

Parameters:

shorter_side_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

SideLengthRange &set_shorter_side_range_right(int shorter_side_range_right)#

Set the right point value of Shorter Side Length Range with std::vector<int> value.

The shorter side length range of regions you want to keep.

Parameters:

shorter_side_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

const std::vector<double> &get_aspect_ratio_range() const#

Get Aspect Ratio Range.

The range of the ratio of the short side to the long side of the regions that you want to keep.

Returns:

const std::vector<double> & Aspect Ratio Range

SideLengthRange &set_aspect_ratio_range(const std::vector<double> &aspect_ratio_range)#

Set Aspect Ratio Range with std::vector<double> value.

The range of the ratio of the short side to the long side of the regions that you want to keep.

Parameters:

aspect_ratio_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

bool aspect_ratio_range_contains(double value) const#

Check if the Aspect Ratio Range contains the value.

Returns:

bool true if the Aspect Ratio Range contains the value, otherwise false.

double get_aspect_ratio_range_left() const#

Get left point value of Aspect Ratio Range.

Returns:

const std::vector<double> & left point value of Aspect Ratio Range

double get_aspect_ratio_range_right() const#

Get the right point value of Aspect Ratio Range.

Returns:

const std::vector<double> & the right point value of Aspect Ratio Range

SideLengthRange &set_aspect_ratio_range_left(double aspect_ratio_range_left)#

Set left point value of Aspect Ratio Range with std::vector<double> value.

The range of the ratio of the short side to the long side of the regions that you want to keep.

Parameters:

aspect_ratio_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

SideLengthRange &set_aspect_ratio_range_right(double aspect_ratio_range_right)#

Set the right point value of Aspect Ratio Range with std::vector<double> value.

The range of the ratio of the short side to the long side of the regions that you want to keep.

Parameters:

aspect_ratio_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SideLengthRange& the reference of this object.

class FilterScript : public aidi::param::ISchemable#

FilterScript Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Filter function.

Enable this option to filter regions with customized python function.

See also

set_enable()

Returns:

bool Enable Filter function

FilterScript &set_enable(bool enable)#

Set Enable Filter function with bool value.

Enable this option to filter regions with customized python function.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

FilterScript& the reference of this object.

const std::string &get_filter_script() const#

Get Filter Script.

The python filter script.

Returns:

const std::string & Filter Script

FilterScript &set_filter_script(const std::string &filter_script)#

Set Filter Script with std::string value.

The python filter script.

Parameters:

filter_script – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

FilterScript& the reference of this object.

class SingleClassPolygonsFilterParamters : public aidi::param::ISchemable#

SingleClassPolygonsFilterParamters Parameter class generated by jinja2 automatically.

Common Regions filter parameters to filter regions.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Enable this polygon filter parameter group.

See also

set_enable()

Returns:

bool Enable

SingleClassPolygonsFilterParamters &set_enable(bool enable)#

Set Enable with bool value.

Enable this polygon filter parameter group.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SingleClassPolygonsFilterParamters& the reference of this object.

double get_score_threshold() const#

Get Score Threshold.

Only retains regions with score greater than this threshold.

Returns:

double Score Threshold

SingleClassPolygonsFilterParamters &set_score_threshold(double score_threshold)#

Set Score Threshold with double value.

Only retains regions with score greater than this threshold.

Parameters:

score_threshold – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SingleClassPolygonsFilterParamters& the reference of this object.

const std::vector<int> &get_area_range() const#

Get Area Range.

The area range of the regions you want to keep

See also

set_area_range()

Returns:

const std::vector<int> & Area Range

SingleClassPolygonsFilterParamters &set_area_range(const std::vector<int> &area_range)#

Set Area Range with std::vector<int> value.

The area range of the regions you want to keep

See also

get_area_range()

Parameters:

area_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SingleClassPolygonsFilterParamters& the reference of this object.

bool area_range_contains(int value) const#

Check if the Area Range contains the value.

Returns:

bool true if the Area Range contains the value, otherwise false.

int get_area_range_left() const#

Get left point value of Area Range.

Returns:

const std::vector<int> & left point value of Area Range

int get_area_range_right() const#

Get the right point value of Area Range.

Returns:

const std::vector<int> & the right point value of Area Range

SingleClassPolygonsFilterParamters &set_area_range_left(int area_range_left)#

Set left point value of Area Range with std::vector<int> value.

The area range of the regions you want to keep

Parameters:

area_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SingleClassPolygonsFilterParamters& the reference of this object.

SingleClassPolygonsFilterParamters &set_area_range_right(int area_range_right)#

Set the right point value of Area Range with std::vector<int> value.

The area range of the regions you want to keep

Parameters:

area_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SingleClassPolygonsFilterParamters& the reference of this object.

const AxialSideLengthRange &get_axial_side_filter() const#

Get Axial-Side-Length Filter.

Filter regions with X/Y-axis side length.

Returns:

const AxialSideLengthRange & Axial-Side-Length Filter

SingleClassPolygonsFilterParamters &set_axial_side_filter(const AxialSideLengthRange &axial_side_filter)#

Set Axial-Side-Length Filter with AxialSideLengthRange value.

Filter regions with X/Y-axis side length.

Parameters:

axial_side_filter – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SingleClassPolygonsFilterParamters& the reference of this object.

AxialSideLengthRange &get_axial_side_filter()#

Get mutable reference of Axial-Side-Length Filter.

Filter regions with X/Y-axis side length.

Returns:

SingleClassPolygonsFilterParamters& the mutable reference of the group.

const SideLengthRange &get_side_filter() const#

Get Side-Length Filter.

Filter regions with Side length

Returns:

const SideLengthRange & Side-Length Filter

SingleClassPolygonsFilterParamters &set_side_filter(const SideLengthRange &side_filter)#

Set Side-Length Filter with SideLengthRange value.

Filter regions with Side length

Parameters:

side_filter – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

SingleClassPolygonsFilterParamters& the reference of this object.

SideLengthRange &get_side_filter()#

Get mutable reference of Side-Length Filter.

Filter regions with Side length

Returns:

SingleClassPolygonsFilterParamters& the mutable reference of the group.

class PolygonsFilterParamters : public aidi::param::SchemableParameter#

PolygonsFilterParamters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const std::map<std::string, SingleClassPolygonsFilterParamters> &get_class_thresholds() const#

Get Class Polygon Thresholds.

Polygon thresholds (area, side-length,etc.) named with the label classes according to which to filter the polygons.

Returns:

const std::map<std::string, SingleClassPolygonsFilterParamters> & Class Polygon Thresholds

PolygonsFilterParamters &set_class_thresholds(const std::map<std::string, SingleClassPolygonsFilterParamters> &class_thresholds)#

Set Class Polygon Thresholds with std::map<std::string, SingleClassPolygonsFilterParamters> value.

Polygon thresholds (area, side-length,etc.) named with the label classes according to which to filter the polygons.

Parameters:

class_thresholds – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

PolygonsFilterParamters& the reference of this object.

const SingleClassPolygonsFilterParamters &get_class_thresholds(const std::string &key) const#

Get value in Class Polygon Thresholds with key.

Warning

The key must be exist in Class Polygon Thresholds. otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::map<std::string, SingleClassPolygonsFilterParamters> & value in Class Polygon Thresholds at key.

PolygonsFilterParamters &set_class_thresholds(const std::string &key, const SingleClassPolygonsFilterParamters &value)#

Set value in Class Polygon Thresholds with key.

Parameters:
  • key – the key to set.

  • value – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

PolygonsFilterParamters& the reference of this object.

bool class_thresholds_contains(const std::string &key) const#

Check if the key is exist in Class Polygon Thresholds.

Returns:

bool true if the key is exist in Class Polygon Thresholds, otherwise false.

size_t get_class_thresholds_size() const#

Get the size of Class Polygon Thresholds.

Returns:

size_t the size of Class Polygon Thresholds

SingleClassPolygonsFilterParamters &get_class_thresholds(const std::string &key)#

Get mutable reference of value in Class Polygon Thresholds with key. A new key and default value will be created if the key does not exist.

Returns:

SingleClassPolygonsFilterParamters& the mutable reference of value in Class Polygon Thresholds at key.

const SingleClassPolygonsFilterParamters &get_additional_threshold() const#

Get Additional Probability Thresholds.

Additional polygon threshold for other label classes not in “Class Polygon Thresholds”. The filter operator will filter all feature maps whose label class is not in “Class Polygon Thresholds” with the additional threshold.

Returns:

const SingleClassPolygonsFilterParamters & Additional Probability Thresholds

PolygonsFilterParamters &set_additional_threshold(const SingleClassPolygonsFilterParamters &additional_threshold)#

Set Additional Probability Thresholds with SingleClassPolygonsFilterParamters value.

Additional polygon threshold for other label classes not in “Class Polygon Thresholds”. The filter operator will filter all feature maps whose label class is not in “Class Polygon Thresholds” with the additional threshold.

Parameters:

additional_threshold – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

PolygonsFilterParamters& the reference of this object.

SingleClassPolygonsFilterParamters &get_additional_threshold()#

Get mutable reference of Additional Probability Thresholds.

Additional polygon threshold for other label classes not in “Class Polygon Thresholds”. The filter operator will filter all feature maps whose label class is not in “Class Polygon Thresholds” with the additional threshold.

Returns:

PolygonsFilterParamters& the mutable reference of the group.

const FilterScript &get_script_filter() const#

Get Custom python filter script.

Filter regions with python script.

Returns:

const FilterScript & Custom python filter script

PolygonsFilterParamters &set_script_filter(const FilterScript &script_filter)#

Set Custom python filter script with FilterScript value.

Filter regions with python script.

Parameters:

script_filter – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

PolygonsFilterParamters& the reference of this object.

FilterScript &get_script_filter()#

Get mutable reference of Custom python filter script.

Filter regions with python script.

Returns:

PolygonsFilterParamters& the mutable reference of the group.

class FeatureMapFilterParameters : public aidi::param::SchemableParameter#

FeatureMapFilterParameters Parameter class generated by jinja2 automatically.

Parameters to config the feature map filter.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const std::map<std::string, double> &get_class_thresholds() const#

Get Class Probability Thresholds.

Thresholds named with the label classes according to which to binarize the feature map.

Returns:

const std::map<std::string, double> & Class Probability Thresholds

FeatureMapFilterParameters &set_class_thresholds(const std::map<std::string, double> &class_thresholds)#

Set Class Probability Thresholds with std::map<std::string, double> value.

Thresholds named with the label classes according to which to binarize the feature map.

Parameters:

class_thresholds – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

FeatureMapFilterParameters& the reference of this object.

double get_class_thresholds(const std::string &key) const#

Get value in Class Probability Thresholds with key.

Warning

The key must be exist in Class Probability Thresholds. otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::map<std::string, double> & value in Class Probability Thresholds at key.

FeatureMapFilterParameters &set_class_thresholds(const std::string &key, double value)#

Set value in Class Probability Thresholds with key.

Parameters:
  • key – the key to set.

  • value – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

FeatureMapFilterParameters& the reference of this object.

bool class_thresholds_contains(const std::string &key) const#

Check if the key is exist in Class Probability Thresholds.

Returns:

bool true if the key is exist in Class Probability Thresholds, otherwise false.

size_t get_class_thresholds_size() const#

Get the size of Class Probability Thresholds.

Returns:

size_t the size of Class Probability Thresholds

double get_additional_threshold() const#

Get Additional Probability Thresholds.

Additional threshold for other label classes not in “Class Probability Thresholds”. The aidi::opers::FeatureMapFilter will filter all feature maps whose label class is not in “Class Probability Thresholds” with the additional threshold.

Returns:

double Additional Probability Thresholds

FeatureMapFilterParameters &set_additional_threshold(double additional_threshold)#

Set Additional Probability Thresholds with double value.

Additional threshold for other label classes not in “Class Probability Thresholds”. The aidi::opers::FeatureMapFilter will filter all feature maps whose label class is not in “Class Probability Thresholds” with the additional threshold.

Parameters:

additional_threshold – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

FeatureMapFilterParameters& the reference of this object.

int get_dilate_pixels() const#

Get Dilate Pixels.

Dilate the filtered regions by the specified pixels. This option can be used to merge closely scattered defects together.

Returns:

int Dilate Pixels

FeatureMapFilterParameters &set_dilate_pixels(int dilate_pixels)#

Set Dilate Pixels with int value.

Dilate the filtered regions by the specified pixels. This option can be used to merge closely scattered defects together.

Parameters:

dilate_pixels – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

FeatureMapFilterParameters& the reference of this object.

Training logs#

class LossCurve : public aidi::param::ISchemable#

LossCurve Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const std::vector<double> &get_values() const#

Get values.

A loss curve

See also

set_values()

Returns:

const std::vector<double> & values

LossCurve &set_values(const std::vector<double> &values)#

Set values with std::vector<double> value.

A loss curve

See also

get_values()

Parameters:

values – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LossCurve& the reference of this object.

double get_values(size_t index) const#

Get value in values with index.

Warning

The index must be less than get_values_size(). otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

double value in values at index.

size_t get_values_size() const#

Get the size of values.

Returns:

size_t the size of values

class TrainingLog : public aidi::param::SchemableParameter#

TrainingLog Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_start_at() const#

Get Start Time.

The training task start time.

See also

set_start_at()

Returns:

int Start Time

TrainingLog &set_start_at(int start_at)#

Set Start Time with int value.

The training task start time.

See also

get_start_at()

Parameters:

start_at – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

TrainingLog& the reference of this object.

int get_end_at() const#

Get End Time.

The training task finish time.

See also

set_end_at()

Returns:

int End Time

TrainingLog &set_end_at(int end_at)#

Set End Time with int value.

The training task finish time.

See also

get_end_at()

Parameters:

end_at – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

TrainingLog& the reference of this object.

const std::map<std::string, LossCurve> &get_loss() const#

Get Loss.

Loss curves with name

See also

set_loss()

Returns:

const std::map<std::string, LossCurve> & Loss

TrainingLog &set_loss(const std::map<std::string, LossCurve> &loss)#

Set Loss with std::map<std::string, LossCurve> value.

Loss curves with name

See also

get_loss()

Parameters:

loss – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

TrainingLog& the reference of this object.

const LossCurve &get_loss(const std::string &key) const#

Get value in Loss with key.

Warning

The key must be exist in Loss. otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::map<std::string, LossCurve> & value in Loss at key.

TrainingLog &set_loss(const std::string &key, const LossCurve &value)#

Set value in Loss with key.

Parameters:
  • key – the key to set.

  • value – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

TrainingLog& the reference of this object.

bool loss_contains(const std::string &key) const#

Check if the key is exist in Loss.

Returns:

bool true if the key is exist in Loss, otherwise false.

size_t get_loss_size() const#

Get the size of Loss.

Returns:

size_t the size of Loss

LossCurve &get_loss(const std::string &key)#

Get mutable reference of value in Loss with key. A new key and default value will be created if the key does not exist.

Returns:

LossCurve& the mutable reference of value in Loss at key.

Ungrouped Parameters#

class InferenceBatchSize : public aidi::param::SchemableParameter#

InferenceBatchSize Parameter class generated by jinja2 automatically.

Inference BatchSize, Currently only contains batch size. It may need to be refactored in the future.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_batch_size() const#

Get Inference Batch Size.

The batch size for inference. You can set it to the number of pictures you wish to infer at the same time. Usually the default value of 1 is sufficient. Note that if you set larger batches without giving enough images per inference, it may actually slow down inference.

See also

set_batch_size()

Returns:

int Inference Batch Size

InferenceBatchSize &set_batch_size(int batch_size)#

Set Inference Batch Size with int value.

The batch size for inference. You can set it to the number of pictures you wish to infer at the same time. Usually the default value of 1 is sufficient. Note that if you set larger batches without giving enough images per inference, it may actually slow down inference.

See also

get_batch_size()

Parameters:

batch_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

InferenceBatchSize& the reference of this object.

class TRTCalibParameters : public aidi::param::SchemableParameter#

TRTCalibParameters Parameter class generated by jinja2 automatically.

TensorRT Int8 Calibrator Parameters

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_place_holder() const#

Get PlaceHolder.

Returns:

bool PlaceHolder

TRTCalibParameters &set_place_holder(bool place_holder)#

Set PlaceHolder with bool value.

Parameters:

place_holder – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

TRTCalibParameters& the reference of this object.

Template Match Parameters#

enum aidi::param::TemplateMode#

Values:

enumerator kValueByPixel = 0#
enumerator kValueByRatio = 1#
class KeyPointNode : public aidi::param::ISchemable#

KeyPointNode Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

double get_x() const#

Get X-Value.

X-direction coordinate value of the center of the key point. When the template modeis set to kValueByPixel, X-Value should be set using pixel value. When the template modeis set to kValueByRatio, X-Value should be set using ratio value. When the Area Value Type is modified, X-Value needs to be modified.

See also

set_x()

Returns:

double X-Value

KeyPointNode &set_x(double x)#

Set X-Value with double value.

X-direction coordinate value of the center of the key point. When the template modeis set to kValueByPixel, X-Value should be set using pixel value. When the template modeis set to kValueByRatio, X-Value should be set using ratio value. When the Area Value Type is modified, X-Value needs to be modified.

See also

get_x()

Parameters:

x – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

KeyPointNode& the reference of this object.

double get_y() const#

Get Y-Value.

Y-direction coordinate value of the center of the key point. When the template modeis set to kValueByPixel, Y-Value should be set using pixel value. When the template modeis set to kValueByRatio, Y-Value should be set using ratio value. When the Area Value Type is modified, Y-Value needs to be modified.

See also

set_y()

Returns:

double Y-Value

KeyPointNode &set_y(double y)#

Set Y-Value with double value.

Y-direction coordinate value of the center of the key point. When the template modeis set to kValueByPixel, Y-Value should be set using pixel value. When the template modeis set to kValueByRatio, Y-Value should be set using ratio value. When the Area Value Type is modified, Y-Value needs to be modified.

See also

get_y()

Parameters:

y – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

KeyPointNode& the reference of this object.

const std::string &get_name() const#

Get Name.

The name that can be matched by the node

See also

set_name()

Returns:

const std::string & Name

KeyPointNode &set_name(const std::string &name)#

Set Name with std::string value.

The name that can be matched by the node

See also

get_name()

Parameters:

name – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

KeyPointNode& the reference of this object.

class MultiNameKeyPointNode : public aidi::param::ISchemable#

MultiNameKeyPointNode Parameter class generated by jinja2 automatically.

Define the position of the node and a set of names that can be matched by the node.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_x() const#

Get X-Value.

X-direction coordinate value of the key point

See also

set_x()

Returns:

int X-Value

MultiNameKeyPointNode &set_x(int x)#

Set X-Value with int value.

X-direction coordinate value of the key point

See also

get_x()

Parameters:

x – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

MultiNameKeyPointNode& the reference of this object.

int get_y() const#

Get Y-Value.

Y-direction coordinate value of the key point

See also

set_y()

Returns:

int Y-Value

MultiNameKeyPointNode &set_y(int y)#

Set Y-Value with int value.

Y-direction coordinate value of the key point

See also

get_y()

Parameters:

y – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

MultiNameKeyPointNode& the reference of this object.

const std::vector<std::string> &get_names() const#

Get Names.

The names that can be matched by the node

See also

set_names()

Returns:

const std::vector<std::string> & Names

MultiNameKeyPointNode &set_names(const std::vector<std::string> &names)#

Set Names with std::vector<std::string> value.

The names that can be matched by the node

See also

get_names()

Parameters:

names – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

MultiNameKeyPointNode& the reference of this object.

const std::string &get_names(size_t index) const#

Get value in Names with index.

Warning

The index must be less than get_names_size(). otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::string & value in Names at index.

size_t get_names_size() const#

Get the size of Names.

Returns:

size_t the size of Names

OCR Parameters#

class RegularExpression : public aidi::param::ISchemable#

RegularExpression Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Whether to use regular expression.

See also

set_enable()

Returns:

bool Enable

RegularExpression &set_enable(bool enable)#

Set Enable with bool value.

Whether to use regular expression.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

RegularExpression& the reference of this object.

const std::string &get_pattern() const#

Get Pattern.

Regular expression pattern

See also

set_pattern()

Returns:

const std::string & Pattern

RegularExpression &set_pattern(const std::string &pattern)#

Set Pattern with std::string value.

Regular expression pattern

See also

get_pattern()

Parameters:

pattern – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

RegularExpression& the reference of this object.

class OCRNodeTemplate : public aidi::param::ISchemable#

OCRNodeTemplate Parameter class generated by jinja2 automatically.

Node template is used to match strings of any shape.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Whether to use node template match

See also

set_enable()

Returns:

bool Enable

OCRNodeTemplate &set_enable(bool enable)#

Set Enable with bool value.

Whether to use node template match

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

int get_max_matches() const#

Get Maximum Matches.

Maximum number of templates to remain within view. Results are sorted based on the match distance in ascending order, and only the top ‘max_matches’ results are retained. All results are provided by default.

Returns:

int Maximum Matches

OCRNodeTemplate &set_max_matches(int max_matches)#

Set Maximum Matches with int value.

Maximum number of templates to remain within view. Results are sorted based on the match distance in ascending order, and only the top ‘max_matches’ results are retained. All results are provided by default.

Parameters:

max_matches – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

const std::vector<MultiNameKeyPointNode> &get_points() const#

Get Keypoints.

The key points of the template

See also

set_points()

Returns:

const std::vector<MultiNameKeyPointNode> & Keypoints

OCRNodeTemplate &set_points(const std::vector<MultiNameKeyPointNode> &points)#

Set Keypoints with std::vector<MultiNameKeyPointNode> value.

The key points of the template

See also

get_points()

Parameters:

points – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

const MultiNameKeyPointNode &get_points(size_t index) const#

Get value in Keypoints with index.

Warning

The index must be less than get_points_size(). otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const MultiNameKeyPointNode & value in Keypoints at index.

size_t get_points_size() const#

Get the size of Keypoints.

Returns:

size_t the size of Keypoints

MultiNameKeyPointNode &get_points(size_t index)#

Get mutable reference of value in Keypoints with index.

Warning

The index must be less than get_points_size(). otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

MultiNameKeyPointNode& the mutable reference of value in Keypoints at index.

double get_offset() const#

Get Offset.

The distance between the node and the character, if greater than the threshold, the matching results will be filtered out.

See also

set_offset()

Returns:

double Offset

OCRNodeTemplate &set_offset(double offset)#

Set Offset with double value.

The distance between the node and the character, if greater than the threshold, the matching results will be filtered out.

See also

get_offset()

Parameters:

offset – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

bool get_is_scalable() const#

Get Target Scalable.

Enable this option if the size of target to be matched is not fixed. And you should set the target scale range.

Returns:

bool Target Scalable

OCRNodeTemplate &set_is_scalable(bool is_scalable)#

Set Target Scalable with bool value.

Enable this option if the size of target to be matched is not fixed. And you should set the target scale range.

Parameters:

is_scalable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

const std::vector<double> &get_scale_range() const#

Get Scale Range.

The target scale range

Returns:

const std::vector<double> & Scale Range

OCRNodeTemplate &set_scale_range(const std::vector<double> &scale_range)#

Set Scale Range with std::vector<double> value.

The target scale range

Parameters:

scale_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

bool scale_range_contains(double value) const#

Check if the Scale Range contains the value.

Returns:

bool true if the Scale Range contains the value, otherwise false.

double get_scale_range_left() const#

Get left point value of Scale Range.

Returns:

const std::vector<double> & left point value of Scale Range

double get_scale_range_right() const#

Get the right point value of Scale Range.

Returns:

const std::vector<double> & the right point value of Scale Range

OCRNodeTemplate &set_scale_range_left(double scale_range_left)#

Set left point value of Scale Range with std::vector<double> value.

The target scale range

Parameters:

scale_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

OCRNodeTemplate &set_scale_range_right(double scale_range_right)#

Set the right point value of Scale Range with std::vector<double> value.

The target scale range

Parameters:

scale_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

bool get_is_rotatable() const#

Get Target Rotatable.

Enable this option if the angle of target to be matched is not fixed, And you should set the target rotate angle range

Returns:

bool Target Rotatable

OCRNodeTemplate &set_is_rotatable(bool is_rotatable)#

Set Target Rotatable with bool value.

Enable this option if the angle of target to be matched is not fixed, And you should set the target rotate angle range

Parameters:

is_rotatable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

const std::vector<int> &get_rotate_range() const#

Get Rotate Range (Degree).

The target rotate range

Returns:

const std::vector<int> & Rotate Range (Degree)

OCRNodeTemplate &set_rotate_range(const std::vector<int> &rotate_range)#

Set Rotate Range (Degree) with std::vector<int> value.

The target rotate range

Parameters:

rotate_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

bool rotate_range_contains(int value) const#

Check if the Rotate Range (Degree) contains the value.

Returns:

bool true if the Rotate Range (Degree) contains the value, otherwise false.

int get_rotate_range_left() const#

Get left point value of Rotate Range (Degree).

Returns:

const std::vector<int> & left point value of Rotate Range (Degree)

int get_rotate_range_right() const#

Get the right point value of Rotate Range (Degree).

Returns:

const std::vector<int> & the right point value of Rotate Range (Degree)

OCRNodeTemplate &set_rotate_range_left(int rotate_range_left)#

Set left point value of Rotate Range (Degree) with std::vector<int> value.

The target rotate range

Parameters:

rotate_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

OCRNodeTemplate &set_rotate_range_right(int rotate_range_right)#

Set the right point value of Rotate Range (Degree) with std::vector<int> value.

The target rotate range

Parameters:

rotate_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRNodeTemplate& the reference of this object.

class OCRStringTemplate : public aidi::param::ISchemable#

OCRStringTemplate Parameter class generated by jinja2 automatically.

String template is used to control how to match characters into strings.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Whether to use string template match

See also

set_enable()

Returns:

bool Enable

OCRStringTemplate &set_enable(bool enable)#

Set Enable with bool value.

Whether to use string template match

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRStringTemplate& the reference of this object.

int get_max_matches() const#

Get Maximum Matches.

Maximum number of templates to remain within view. Results are sorted based on the deviation of characters from the string, and only the top ‘max_matches’ results are retained. All results are provided by default.

Returns:

int Maximum Matches

OCRStringTemplate &set_max_matches(int max_matches)#

Set Maximum Matches with int value.

Maximum number of templates to remain within view. Results are sorted based on the deviation of characters from the string, and only the top ‘max_matches’ results are retained. All results are provided by default.

Parameters:

max_matches – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRStringTemplate& the reference of this object.

int get_min_length() const#

Get Minimum String Length.

String shorter than the minimum length will be ignored.

See also

set_min_length()

Returns:

int Minimum String Length

OCRStringTemplate &set_min_length(int min_length)#

Set Minimum String Length with int value.

String shorter than the minimum length will be ignored.

See also

get_min_length()

Parameters:

min_length – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRStringTemplate& the reference of this object.

double get_max_char_interval() const#

Get Maximum Character Interval.

The maximum interval between characters in a string, Two characters with interval longer than this threshold will be matched into two different strings.

Returns:

double Maximum Character Interval

OCRStringTemplate &set_max_char_interval(double max_char_interval)#

Set Maximum Character Interval with double value.

The maximum interval between characters in a string, Two characters with interval longer than this threshold will be matched into two different strings.

Parameters:

max_char_interval – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRStringTemplate& the reference of this object.

int get_main_direction() const#

Get String Main Direction.

Direction of strings based on statistics. (It is specified that the positive x-axis direction is 0 degrees, positive values representing the direction towards the positive y-axis, negative values indicating the direction towards the negative y-axis.)

Returns:

int String Main Direction

OCRStringTemplate &set_main_direction(int main_direction)#

Set String Main Direction with int value.

Direction of strings based on statistics. (It is specified that the positive x-axis direction is 0 degrees, positive values representing the direction towards the positive y-axis, negative values indicating the direction towards the negative y-axis.)

Parameters:

main_direction – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRStringTemplate& the reference of this object.

int get_angle_range() const#

Get Rotate Angle Range.

The rotate angle range of the string, which means that the string can be rotated slightly within an angular range centered on the main direction.

Returns:

int Rotate Angle Range

OCRStringTemplate &set_angle_range(int angle_range)#

Set Rotate Angle Range with int value.

The rotate angle range of the string, which means that the string can be rotated slightly within an angular range centered on the main direction.

Parameters:

angle_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRStringTemplate& the reference of this object.

const RegularExpression &get_regular_expression() const#

Get Regular Expression.

Regular Expression Parameter

Returns:

const RegularExpression & Regular Expression

OCRStringTemplate &set_regular_expression(const RegularExpression &regular_expression)#

Set Regular Expression with RegularExpression value.

Regular Expression Parameter

Parameters:

regular_expression – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRStringTemplate& the reference of this object.

RegularExpression &get_regular_expression()#

Get mutable reference of Regular Expression.

Regular Expression Parameter

Returns:

OCRStringTemplate& the mutable reference of the group.

class OCRFilterParameters : public aidi::param::SchemableParameter#

OCRFilterParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

double get_threshold() const#

Get Confidence Threshold.

Keypoints with confidence greater than this threshold will be determined as a character target.

See also

set_threshold()

Returns:

double Confidence Threshold

OCRFilterParameters &set_threshold(double threshold)#

Set Confidence Threshold with double value.

Keypoints with confidence greater than this threshold will be determined as a character target.

See also

get_threshold()

Parameters:

threshold – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRFilterParameters& the reference of this object.

double get_density() const#

Get Search Denisty.

Filter out duplicate keypoints by NMS. A larger value will remain fewer keypoints.

See also

set_density()

Returns:

double Search Denisty

OCRFilterParameters &set_density(double density)#

Set Search Denisty with double value.

Filter out duplicate keypoints by NMS. A larger value will remain fewer keypoints.

See also

get_density()

Parameters:

density – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRFilterParameters& the reference of this object.

class OCRInferParameters : public aidi::param::SchemableParameter#

OCRInferParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Customize Character Size.

Enable this option to customize target character size if the character in inference image is not match with the size of training data.

See also

set_enable()

Returns:

bool Customize Character Size

OCRInferParameters &set_enable(bool enable)#

Set Customize Character Size with bool value.

Enable this option to customize target character size if the character in inference image is not match with the size of training data.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRInferParameters& the reference of this object.

double get_target_feat_width() const#

Get Target Character Width.

The target character width in inference data.

Returns:

double Target Character Width

OCRInferParameters &set_target_feat_width(double target_feat_width)#

Set Target Character Width with double value.

The target character width in inference data.

Parameters:

target_feat_width – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRInferParameters& the reference of this object.

double get_target_feat_height() const#

Get Target Character Height.

The target character height in inference data.

Returns:

double Target Character Height

OCRInferParameters &set_target_feat_height(double target_feat_height)#

Set Target Character Height with double value.

The target character height in inference data.

Parameters:

target_feat_height – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRInferParameters& the reference of this object.

class OCRTemplates : public aidi::param::SchemableParameter#

OCRTemplates Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const std::map<std::string, OCRStringTemplate> &get_string_templates() const#

Get String Templates.

String templates.

Returns:

const std::map<std::string, OCRStringTemplate> & String Templates

OCRTemplates &set_string_templates(const std::map<std::string, OCRStringTemplate> &string_templates)#

Set String Templates with std::map<std::string, OCRStringTemplate> value.

String templates.

Parameters:

string_templates – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTemplates& the reference of this object.

const OCRStringTemplate &get_string_templates(const std::string &key) const#

Get value in String Templates with key.

Warning

The key must be exist in String Templates. otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::map<std::string, OCRStringTemplate> & value in String Templates at key.

OCRTemplates &set_string_templates(const std::string &key, const OCRStringTemplate &value)#

Set value in String Templates with key.

Parameters:
  • key – the key to set.

  • value – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTemplates& the reference of this object.

bool string_templates_contains(const std::string &key) const#

Check if the key is exist in String Templates.

Returns:

bool true if the key is exist in String Templates, otherwise false.

size_t get_string_templates_size() const#

Get the size of String Templates.

Returns:

size_t the size of String Templates

OCRStringTemplate &get_string_templates(const std::string &key)#

Get mutable reference of value in String Templates with key. A new key and default value will be created if the key does not exist.

Returns:

OCRStringTemplate& the mutable reference of value in String Templates at key.

const std::map<std::string, OCRNodeTemplate> &get_node_templates() const#

Get Node Templates.

Node templates.

Returns:

const std::map<std::string, OCRNodeTemplate> & Node Templates

OCRTemplates &set_node_templates(const std::map<std::string, OCRNodeTemplate> &node_templates)#

Set Node Templates with std::map<std::string, OCRNodeTemplate> value.

Node templates.

Parameters:

node_templates – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTemplates& the reference of this object.

const OCRNodeTemplate &get_node_templates(const std::string &key) const#

Get value in Node Templates with key.

Warning

The key must be exist in Node Templates. otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::map<std::string, OCRNodeTemplate> & value in Node Templates at key.

OCRTemplates &set_node_templates(const std::string &key, const OCRNodeTemplate &value)#

Set value in Node Templates with key.

Parameters:
  • key – the key to set.

  • value – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTemplates& the reference of this object.

bool node_templates_contains(const std::string &key) const#

Check if the key is exist in Node Templates.

Returns:

bool true if the key is exist in Node Templates, otherwise false.

size_t get_node_templates_size() const#

Get the size of Node Templates.

Returns:

size_t the size of Node Templates

OCRNodeTemplate &get_node_templates(const std::string &key)#

Get mutable reference of value in Node Templates with key. A new key and default value will be created if the key does not exist.

Returns:

OCRNodeTemplate& the mutable reference of value in Node Templates at key.

class OCRAnnulusParameters : public aidi::param::ISchemable#

OCRAnnulusParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Enable this option to recognise characters arranged in a circular pattern.

See also

set_enable()

Returns:

bool Enable

OCRAnnulusParameters &set_enable(bool enable)#

Set Enable with bool value.

Enable this option to recognise characters arranged in a circular pattern.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRAnnulusParameters& the reference of this object.

double get_x() const#

Get Center X.

The x-coordinate of the center of the annulus, set according to the percentage of the view height.

See also

set_x()

Returns:

double Center X

OCRAnnulusParameters &set_x(double x)#

Set Center X with double value.

The x-coordinate of the center of the annulus, set according to the percentage of the view height.

See also

get_x()

Parameters:

x – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRAnnulusParameters& the reference of this object.

double get_y() const#

Get Center Y.

The y-coordinate of the center of the annulus, set according to the percentage of the view height.

See also

set_y()

Returns:

double Center Y

OCRAnnulusParameters &set_y(double y)#

Set Center Y with double value.

The y-coordinate of the center of the annulus, set according to the percentage of the view height.

See also

get_y()

Parameters:

y – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRAnnulusParameters& the reference of this object.

double get_inner_radius() const#

Get Inner Radius.

The inner radius of the annulus, set according to the percentage of the view height.

Returns:

double Inner Radius

OCRAnnulusParameters &set_inner_radius(double inner_radius)#

Set Inner Radius with double value.

The inner radius of the annulus, set according to the percentage of the view height.

Parameters:

inner_radius – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRAnnulusParameters& the reference of this object.

double get_outer_radius() const#

Get Outer Radius.

The outer radius of the annulus, set according to the percentage of the view height.

Returns:

double Outer Radius

OCRAnnulusParameters &set_outer_radius(double outer_radius)#

Set Outer Radius with double value.

The outer radius of the annulus, set according to the percentage of the view height.

Parameters:

outer_radius – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRAnnulusParameters& the reference of this object.

double get_start_angle() const#

Get Start Angle.

It is specified that the positive x-axis direction is 0 degrees, positive values representing the direction towards the negative y-axis, negative values indicating the direction towards the positive y-axis.

Returns:

double Start Angle

OCRAnnulusParameters &set_start_angle(double start_angle)#

Set Start Angle with double value.

It is specified that the positive x-axis direction is 0 degrees, positive values representing the direction towards the negative y-axis, negative values indicating the direction towards the positive y-axis.

Parameters:

start_angle – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRAnnulusParameters& the reference of this object.

double get_angle_range() const#

Get Angle Range.

The range of angle in which the annulus is unwrapped, if the angle is greater than 360 degrees or less than -360 degrees, the excess part will be unwrapped repeatly. Positive values representing the direction towards the negative y-axis, negative values indicating the direction towards the positive y-axis.

Returns:

double Angle Range

OCRAnnulusParameters &set_angle_range(double angle_range)#

Set Angle Range with double value.

The range of angle in which the annulus is unwrapped, if the angle is greater than 360 degrees or less than -360 degrees, the excess part will be unwrapped repeatly. Positive values representing the direction towards the negative y-axis, negative values indicating the direction towards the positive y-axis.

Parameters:

angle_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRAnnulusParameters& the reference of this object.

class OCRTrainingParameters : public aidi::param::SchemableParameter#

OCRTrainingParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_epoch() const#

Get Epoch.

Number of epochs to train

See also

set_epoch()

Returns:

int Epoch

OCRTrainingParameters &set_epoch(int epoch)#

Set Epoch with int value.

Number of epochs to train

See also

get_epoch()

Parameters:

epoch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTrainingParameters& the reference of this object.

int get_batch_size() const#

Get Training Batch Size.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

set_batch_size()

Returns:

int Training Batch Size

OCRTrainingParameters &set_batch_size(int batch_size)#

Set Training Batch Size with int value.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

get_batch_size()

Parameters:

batch_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTrainingParameters& the reference of this object.

double get_step_ratio() const#

Get Learning Rate Update Step Ratio.

The ratio of iterations after which the learning rate is decreased.

See also

set_step_ratio()

Returns:

double Learning Rate Update Step Ratio

OCRTrainingParameters &set_step_ratio(double step_ratio)#

Set Learning Rate Update Step Ratio with double value.

The ratio of iterations after which the learning rate is decreased.

See also

get_step_ratio()

Parameters:

step_ratio – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTrainingParameters& the reference of this object.

const DataAugmentation &get_augmentations() const#

Get Data Augmentation.

Data Augmentation Parameters

Returns:

const DataAugmentation & Data Augmentation

OCRTrainingParameters &set_augmentations(const DataAugmentation &augmentations)#

Set Data Augmentation with DataAugmentation value.

Data Augmentation Parameters

Parameters:

augmentations – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTrainingParameters& the reference of this object.

DataAugmentation &get_augmentations()#

Get mutable reference of Data Augmentation.

Data Augmentation Parameters

Returns:

OCRTrainingParameters& the mutable reference of the group.

int get_sigma() const#

Get Sigma.

Determines the spread of Gaussian distribution used to generate heatmaps. A larger value will result in a larger area of distribution, vice versa.

See also

set_sigma()

Returns:

int Sigma

OCRTrainingParameters &set_sigma(int sigma)#

Set Sigma with int value.

Determines the spread of Gaussian distribution used to generate heatmaps. A larger value will result in a larger area of distribution, vice versa.

See also

get_sigma()

Parameters:

sigma – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTrainingParameters& the reference of this object.

int get_target_feature_size() const#

Get Target Feature Size.

The desired size to which the input features are scaled

Returns:

int Target Feature Size

OCRTrainingParameters &set_target_feature_size(int target_feature_size)#

Set Target Feature Size with int value.

The desired size to which the input features are scaled

Parameters:

target_feature_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTrainingParameters& the reference of this object.

const OCRAnnulusParameters &get_annulus_recognition() const#

Get Annulus Character Recognition.

Annulus Character Recognition Parameters

Returns:

const OCRAnnulusParameters & Annulus Character Recognition

OCRTrainingParameters &set_annulus_recognition(const OCRAnnulusParameters &annulus_recognition)#

Set Annulus Character Recognition with OCRAnnulusParameters value.

Annulus Character Recognition Parameters

Parameters:

annulus_recognition – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

OCRTrainingParameters& the reference of this object.

OCRAnnulusParameters &get_annulus_recognition()#

Get mutable reference of Annulus Character Recognition.

Annulus Character Recognition Parameters

Returns:

OCRTrainingParameters& the mutable reference of the group.

Location Tool Parameters#

class LocationMaxInputSize : public aidi::param::ISchemable#

LocationMaxInputSize Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Set Max Size.

Enable this option to manually set the maximum side length of the input image.

See also

set_enable()

Returns:

bool Enable Set Max Size

LocationMaxInputSize &set_enable(bool enable)#

Set Enable Set Max Size with bool value.

Enable this option to manually set the maximum side length of the input image.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationMaxInputSize& the reference of this object.

double get_max_side_len() const#

Get Max Input Size.

Scale the long edge of the input image to the maximum side length, and scale the short edge equally, if the algorithm calculates that the required maximum edge length is smaller than this parameter, the maximum edge length will be set automatically

Returns:

double Max Input Size

LocationMaxInputSize &set_max_side_len(double max_side_len)#

Set Max Input Size with double value.

Scale the long edge of the input image to the maximum side length, and scale the short edge equally, if the algorithm calculates that the required maximum edge length is smaller than this parameter, the maximum edge length will be set automatically

Parameters:

max_side_len – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationMaxInputSize& the reference of this object.

class LocationModelParameters : public aidi::param::ISchemable#

LocationModelParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const std::string &get_model_arch() const#

Get Model Architecture.

There are two different model architectures: the High-Precision-Location model and Fast-Location model, The high-precision version is suitable for scenarios with positioning accuracy up to 1 pixel, and the fast version is suitable for most scenarios with shorter training, inference time and lower GPU memeory requirements.

See also

set_model_arch()

Returns:

const std::string & Model Architecture

LocationModelParameters &set_model_arch(const std::string &model_arch)#

Set Model Architecture with std::string value.

There are two different model architectures: the High-Precision-Location model and Fast-Location model, The high-precision version is suitable for scenarios with positioning accuracy up to 1 pixel, and the fast version is suitable for most scenarios with shorter training, inference time and lower GPU memeory requirements.

See also

get_model_arch()

Parameters:

model_arch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationModelParameters& the reference of this object.

bool get_train_angle() const#

Get Training With Angle.

Enable this option to training the model with the angle infomations in the label.

Returns:

bool Training With Angle

LocationModelParameters &set_train_angle(bool train_angle)#

Set Training With Angle with bool value.

Enable this option to training the model with the angle infomations in the label.

Parameters:

train_angle – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationModelParameters& the reference of this object.

bool get_train_rect() const#

Get Training With Rect Size.

Enable this option to training the model with the the rectangle size infomation of the target box

See also

set_train_rect()

Returns:

bool Training With Rect Size

LocationModelParameters &set_train_rect(bool train_rect)#

Set Training With Rect Size with bool value.

Enable this option to training the model with the the rectangle size infomation of the target box

See also

get_train_rect()

Parameters:

train_rect – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationModelParameters& the reference of this object.

class LocationTargetParameters : public aidi::param::ISchemable#

LocationTargetParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

double get_min_target_width() const#

Get Minimum Target Width.

The Minimum target width (Pixel value in X-axis direction)

Returns:

double Minimum Target Width

LocationTargetParameters &set_min_target_width(double min_target_width)#

Set Minimum Target Width with double value.

The Minimum target width (Pixel value in X-axis direction)

Parameters:

min_target_width – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTargetParameters& the reference of this object.

double get_min_target_height() const#

Get Minimum Target Height.

The Minimum target height (Pixel value in Y-axis direction)

Returns:

double Minimum Target Height

LocationTargetParameters &set_min_target_height(double min_target_height)#

Set Minimum Target Height with double value.

The Minimum target height (Pixel value in Y-axis direction)

Parameters:

min_target_height – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTargetParameters& the reference of this object.

class NodeMatchTemplate : public aidi::param::ISchemable#

NodeMatchTemplate Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Note Match Template.

Enable this option to use this template

See also

set_enable()

Returns:

bool Enable Note Match Template

NodeMatchTemplate &set_enable(bool enable)#

Set Enable Note Match Template with bool value.

Enable this option to use this template

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

const TemplateMode &get_template_mode() const#

Get Tempalte Mode.

Set the value type of points and offset. When the template mode is set to kValueByPixel, the Coordinates of points and the offset should be set using pixel value. When the template mode is set to kValueByRatio, the Coordinates of points and the offset should be set using ratio value. When the Area Value Type is modified, the Coordinates of points and the offset should be modified.

Returns:

const TemplateMode & Tempalte Mode

NodeMatchTemplate &set_template_mode(const TemplateMode &template_mode)#

Set Tempalte Mode with TemplateMode value.

Set the value type of points and offset. When the template mode is set to kValueByPixel, the Coordinates of points and the offset should be set using pixel value. When the template mode is set to kValueByRatio, the Coordinates of points and the offset should be set using ratio value. When the Area Value Type is modified, the Coordinates of points and the offset should be modified.

Parameters:

template_mode – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

int get_max_match_results_num() const#

Get Max Match Results Num.

the maximum number of template matching results. When the value is - 1, the maximum number of matching results is not limited.

Returns:

int Max Match Results Num

NodeMatchTemplate &set_max_match_results_num(int max_match_results_num)#

Set Max Match Results Num with int value.

the maximum number of template matching results. When the value is - 1, the maximum number of matching results is not limited.

Parameters:

max_match_results_num – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

int get_max_miss_points_num() const#

Get Max Miss Points Num.

The number of points allowed to be missed during matching

Returns:

int Max Miss Points Num

NodeMatchTemplate &set_max_miss_points_num(int max_miss_points_num)#

Set Max Miss Points Num with int value.

The number of points allowed to be missed during matching

Parameters:

max_miss_points_num – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

const std::vector<KeyPointNode> &get_points() const#

Get Keypoints.

The key points of the template

See also

set_points()

Returns:

const std::vector<KeyPointNode> & Keypoints

NodeMatchTemplate &set_points(const std::vector<KeyPointNode> &points)#

Set Keypoints with std::vector<KeyPointNode> value.

The key points of the template

See also

get_points()

Parameters:

points – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

const KeyPointNode &get_points(size_t index) const#

Get value in Keypoints with index.

Warning

The index must be less than get_points_size(). otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const KeyPointNode & value in Keypoints at index.

size_t get_points_size() const#

Get the size of Keypoints.

Returns:

size_t the size of Keypoints

KeyPointNode &get_points(size_t index)#

Get mutable reference of value in Keypoints with index.

Warning

The index must be less than get_points_size(). otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

KeyPointNode& the mutable reference of value in Keypoints at index.

double get_offset() const#

Get Target Offset.

The value of point offset allowed when matching. When the template modeis set to kValueByPixel, Target Offset should be set using pixel value. When the template modeis set to kValueByRatio, Target Offset should be set using ratio value. When the Area Value Type is modified, Target Offset needs to be modified.

See also

set_offset()

Returns:

double Target Offset

NodeMatchTemplate &set_offset(double offset)#

Set Target Offset with double value.

The value of point offset allowed when matching. When the template modeis set to kValueByPixel, Target Offset should be set using pixel value. When the template modeis set to kValueByRatio, Target Offset should be set using ratio value. When the Area Value Type is modified, Target Offset needs to be modified.

See also

get_offset()

Parameters:

offset – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

bool get_is_scalable() const#

Get Target Scalable.

Enable this option if the scale of target to be matched is not fixed, And you should set the target scale range

Returns:

bool Target Scalable

NodeMatchTemplate &set_is_scalable(bool is_scalable)#

Set Target Scalable with bool value.

Enable this option if the scale of target to be matched is not fixed, And you should set the target scale range

Parameters:

is_scalable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

const std::vector<double> &get_scale_range() const#

Get Scale Range.

The target scale range

Returns:

const std::vector<double> & Scale Range

NodeMatchTemplate &set_scale_range(const std::vector<double> &scale_range)#

Set Scale Range with std::vector<double> value.

The target scale range

Parameters:

scale_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

bool scale_range_contains(double value) const#

Check if the Scale Range contains the value.

Returns:

bool true if the Scale Range contains the value, otherwise false.

double get_scale_range_left() const#

Get left point value of Scale Range.

Returns:

const std::vector<double> & left point value of Scale Range

double get_scale_range_right() const#

Get the right point value of Scale Range.

Returns:

const std::vector<double> & the right point value of Scale Range

NodeMatchTemplate &set_scale_range_left(double scale_range_left)#

Set left point value of Scale Range with std::vector<double> value.

The target scale range

Parameters:

scale_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

NodeMatchTemplate &set_scale_range_right(double scale_range_right)#

Set the right point value of Scale Range with std::vector<double> value.

The target scale range

Parameters:

scale_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

bool get_is_rotatable() const#

Get Target Rotatable.

Enable this option if the angle of target to be matched is not fixed, And you should set the target rotate angle range

Returns:

bool Target Rotatable

NodeMatchTemplate &set_is_rotatable(bool is_rotatable)#

Set Target Rotatable with bool value.

Enable this option if the angle of target to be matched is not fixed, And you should set the target rotate angle range

Parameters:

is_rotatable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

const std::vector<int> &get_rotate_range() const#

Get Rotate Range (Degree).

The target rotate range

Returns:

const std::vector<int> & Rotate Range (Degree)

NodeMatchTemplate &set_rotate_range(const std::vector<int> &rotate_range)#

Set Rotate Range (Degree) with std::vector<int> value.

The target rotate range

Parameters:

rotate_range – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

bool rotate_range_contains(int value) const#

Check if the Rotate Range (Degree) contains the value.

Returns:

bool true if the Rotate Range (Degree) contains the value, otherwise false.

int get_rotate_range_left() const#

Get left point value of Rotate Range (Degree).

Returns:

const std::vector<int> & left point value of Rotate Range (Degree)

int get_rotate_range_right() const#

Get the right point value of Rotate Range (Degree).

Returns:

const std::vector<int> & the right point value of Rotate Range (Degree)

NodeMatchTemplate &set_rotate_range_left(int rotate_range_left)#

Set left point value of Rotate Range (Degree) with std::vector<int> value.

The target rotate range

Parameters:

rotate_range_left – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

NodeMatchTemplate &set_rotate_range_right(int rotate_range_right)#

Set the right point value of Rotate Range (Degree) with std::vector<int> value.

The target rotate range

Parameters:

rotate_range_right – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

double get_template_angle() const#

Get Tempalte angle.

Template angle is calculated and displayedby the software in real time

Returns:

double Tempalte angle

NodeMatchTemplate &set_template_angle(double template_angle)#

Set Tempalte angle with double value.

Template angle is calculated and displayedby the software in real time

Parameters:

template_angle – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

NodeMatchTemplate& the reference of this object.

class LocationTemplates : public aidi::param::SchemableParameter#

LocationTemplates Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const std::map<std::string, NodeMatchTemplate> &get_node_templates() const#

Get Node Templates.

The Location node match templates

Returns:

const std::map<std::string, NodeMatchTemplate> & Node Templates

LocationTemplates &set_node_templates(const std::map<std::string, NodeMatchTemplate> &node_templates)#

Set Node Templates with std::map<std::string, NodeMatchTemplate> value.

The Location node match templates

Parameters:

node_templates – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTemplates& the reference of this object.

const NodeMatchTemplate &get_node_templates(const std::string &key) const#

Get value in Node Templates with key.

Warning

The key must be exist in Node Templates. otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::map<std::string, NodeMatchTemplate> & value in Node Templates at key.

LocationTemplates &set_node_templates(const std::string &key, const NodeMatchTemplate &value)#

Set value in Node Templates with key.

Parameters:
  • key – the key to set.

  • value – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTemplates& the reference of this object.

bool node_templates_contains(const std::string &key) const#

Check if the key is exist in Node Templates.

Returns:

bool true if the key is exist in Node Templates, otherwise false.

size_t get_node_templates_size() const#

Get the size of Node Templates.

Returns:

size_t the size of Node Templates

NodeMatchTemplate &get_node_templates(const std::string &key)#

Get mutable reference of value in Node Templates with key. A new key and default value will be created if the key does not exist.

Returns:

NodeMatchTemplate& the mutable reference of value in Node Templates at key.

class LocationTrainingParameters : public aidi::param::SchemableParameter#

LocationTrainingParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_epoch() const#

Get Epoch.

Number of epochs to train

See also

set_epoch()

Returns:

int Epoch

LocationTrainingParameters &set_epoch(int epoch)#

Set Epoch with int value.

Number of epochs to train

See also

get_epoch()

Parameters:

epoch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTrainingParameters& the reference of this object.

int get_batch_size() const#

Get Training Batch Size.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

set_batch_size()

Returns:

int Training Batch Size

LocationTrainingParameters &set_batch_size(int batch_size)#

Set Training Batch Size with int value.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

get_batch_size()

Parameters:

batch_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTrainingParameters& the reference of this object.

const DataAugmentation &get_augmentations() const#

Get Data Augmentation.

Data Augmentation Parameters

Returns:

const DataAugmentation & Data Augmentation

LocationTrainingParameters &set_augmentations(const DataAugmentation &augmentations)#

Set Data Augmentation with DataAugmentation value.

Data Augmentation Parameters

Parameters:

augmentations – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTrainingParameters& the reference of this object.

DataAugmentation &get_augmentations()#

Get mutable reference of Data Augmentation.

Data Augmentation Parameters

Returns:

LocationTrainingParameters& the mutable reference of the group.

const LocationMaxInputSize &get_input_shape() const#

Get Input Shape.

Input Shape Parameters

Returns:

const LocationMaxInputSize & Input Shape

LocationTrainingParameters &set_input_shape(const LocationMaxInputSize &input_shape)#

Set Input Shape with LocationMaxInputSize value.

Input Shape Parameters

Parameters:

input_shape – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTrainingParameters& the reference of this object.

LocationMaxInputSize &get_input_shape()#

Get mutable reference of Input Shape.

Input Shape Parameters

Returns:

LocationTrainingParameters& the mutable reference of the group.

const LocationModelParameters &get_model_param() const#

Get Model param.

Location model parameters

Returns:

const LocationModelParameters & Model param

LocationTrainingParameters &set_model_param(const LocationModelParameters &model_param)#

Set Model param with LocationModelParameters value.

Location model parameters

Parameters:

model_param – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTrainingParameters& the reference of this object.

LocationModelParameters &get_model_param()#

Get mutable reference of Model param.

Location model parameters

Returns:

LocationTrainingParameters& the mutable reference of the group.

const LocationTargetParameters &get_target_feature() const#

Get Target Feature.

Location Target Feature Parameters

Returns:

const LocationTargetParameters & Target Feature

LocationTrainingParameters &set_target_feature(const LocationTargetParameters &target_feature)#

Set Target Feature with LocationTargetParameters value.

Location Target Feature Parameters

Parameters:

target_feature – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationTrainingParameters& the reference of this object.

LocationTargetParameters &get_target_feature()#

Get mutable reference of Target Feature.

Location Target Feature Parameters

Returns:

LocationTrainingParameters& the mutable reference of the group.

class LocationFilterParameters : public aidi::param::SchemableParameter#

LocationFilterParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

double get_threshold() const#

Get Confidence Threshold.

Keypoints with confidence greater than this threshold will be determined as a character target.

See also

set_threshold()

Returns:

double Confidence Threshold

LocationFilterParameters &set_threshold(double threshold)#

Set Confidence Threshold with double value.

Keypoints with confidence greater than this threshold will be determined as a character target.

See also

get_threshold()

Parameters:

threshold – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationFilterParameters& the reference of this object.

double get_density() const#

Get Search Denisty.

SKeep only one result within the radius of target size * density

See also

set_density()

Returns:

double Search Denisty

LocationFilterParameters &set_density(double density)#

Set Search Denisty with double value.

SKeep only one result within the radius of target size * density

See also

get_density()

Parameters:

density – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

LocationFilterParameters& the reference of this object.

AssemblyVerification Tool Parameters#

class AssemblyVerificationMaxInputSize : public aidi::param::ISchemable#

AssemblyVerificationMaxInputSize Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Set Max Size.

Enable this option to manually set the maximum side length of the input image.

See also

set_enable()

Returns:

bool Enable Set Max Size

AssemblyVerificationMaxInputSize &set_enable(bool enable)#

Set Enable Set Max Size with bool value.

Enable this option to manually set the maximum side length of the input image.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationMaxInputSize& the reference of this object.

double get_max_side_len() const#

Get Max Input Size.

Scale the long edge of the input image to the maximum side length, and scale the short edge equally, if the algorithm calculates that the required maximum edge length is smaller than this parameter, the maximum edge length will be set automatically

Returns:

double Max Input Size

AssemblyVerificationMaxInputSize &set_max_side_len(double max_side_len)#

Set Max Input Size with double value.

Scale the long edge of the input image to the maximum side length, and scale the short edge equally, if the algorithm calculates that the required maximum edge length is smaller than this parameter, the maximum edge length will be set automatically

Parameters:

max_side_len – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationMaxInputSize& the reference of this object.

class AssemblyVerificationLayOutArea : public aidi::param::ISchemable#

AssemblyVerificationLayOutArea Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_x() const#

Get X-Value.

X-direction coordinate value of the center of the area. When the template mode is set to kValueByPixel, X-Value should be set using pixel value. When the template mode is set to kValueByRatio, X-Value should be set using ratio value. When the template mode is modified, X-Value needs to be modified.

See also

set_x()

Returns:

int X-Value

AssemblyVerificationLayOutArea &set_x(int x)#

Set X-Value with int value.

X-direction coordinate value of the center of the area. When the template mode is set to kValueByPixel, X-Value should be set using pixel value. When the template mode is set to kValueByRatio, X-Value should be set using ratio value. When the template mode is modified, X-Value needs to be modified.

See also

get_x()

Parameters:

x – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationLayOutArea& the reference of this object.

int get_y() const#

Get Y-Value.

Y-direction coordinate value of the center of the area. When the template mode is set to kValueByPixel, Y-Value should be set using pixel value. When the template mode is set to kValueByRatio, Y-Value should be set using ratio value. When the template mode is modified, Y-Value needs to be modified.

See also

set_y()

Returns:

int Y-Value

AssemblyVerificationLayOutArea &set_y(int y)#

Set Y-Value with int value.

Y-direction coordinate value of the center of the area. When the template mode is set to kValueByPixel, Y-Value should be set using pixel value. When the template mode is set to kValueByRatio, Y-Value should be set using ratio value. When the template mode is modified, Y-Value needs to be modified.

See also

get_y()

Parameters:

y – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationLayOutArea& the reference of this object.

int get_w() const#

Get W-Value.

width of the area. When the template mode is set to kValueByPixel, W-Value should be set using pixel value. When the template mode is set to kValueByRatio, W-Value should be set using ratio value. When the template mode is modified, W-Value needs to be modified.

See also

set_w()

Returns:

int W-Value

AssemblyVerificationLayOutArea &set_w(int w)#

Set W-Value with int value.

width of the area. When the template mode is set to kValueByPixel, W-Value should be set using pixel value. When the template mode is set to kValueByRatio, W-Value should be set using ratio value. When the template mode is modified, W-Value needs to be modified.

See also

get_w()

Parameters:

w – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationLayOutArea& the reference of this object.

int get_h() const#

Get H-Value.

height of the area. When the template mode is set to kValueByPixel, H-Value should be set using pixel value. When the template mode is set to kValueRatio, H-Value should be set using ratio value. When the template mode is modified, H-Value needs to be modified.

See also

set_h()

Returns:

int H-Value

AssemblyVerificationLayOutArea &set_h(int h)#

Set H-Value with int value.

height of the area. When the template mode is set to kValueByPixel, H-Value should be set using pixel value. When the template mode is set to kValueRatio, H-Value should be set using ratio value. When the template mode is modified, H-Value needs to be modified.

See also

get_h()

Parameters:

h – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationLayOutArea& the reference of this object.

const std::vector<std::string> &get_target_category() const#

Get Target Category.

Categories of targets in the area

Returns:

const std::vector<std::string> & Target Category

AssemblyVerificationLayOutArea &set_target_category(const std::vector<std::string> &target_category)#

Set Target Category with std::vector<std::string> value.

Categories of targets in the area

Parameters:

target_category – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationLayOutArea& the reference of this object.

const std::string &get_target_category(size_t index) const#

Get value in Target Category with index.

Warning

The index must be less than get_target_category_size(). otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::string & value in Target Category at index.

size_t get_target_category_size() const#

Get the size of Target Category.

Returns:

size_t the size of Target Category

int get_target_number() const#

Get Target Number.

Number of targets in the region

Returns:

int Target Number

AssemblyVerificationLayOutArea &set_target_number(int target_number)#

Set Target Number with int value.

Number of targets in the region

Parameters:

target_number – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationLayOutArea& the reference of this object.

class AssemblyVerificationTemplates : public aidi::param::SchemableParameter#

AssemblyVerificationTemplates Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

const TemplateMode &get_template_mode() const#

Get Tempalte Mode.

Set the Value Type of the central coordinates of the region and the width and height of the area. When the template mode is set to kValueByPixel, X-Value Y-Value W-Value H-Value should be set using pixel value. When the template mode is set to kValueByRatio, X-Value Y-Value W-Value H-Value should be set using ratio value. When the template mode is modified, X-Value Y-Value W-Value H-Value needs to be modified.

Returns:

const TemplateMode & Tempalte Mode

AssemblyVerificationTemplates &set_template_mode(const TemplateMode &template_mode)#

Set Tempalte Mode with TemplateMode value.

Set the Value Type of the central coordinates of the region and the width and height of the area. When the template mode is set to kValueByPixel, X-Value Y-Value W-Value H-Value should be set using pixel value. When the template mode is set to kValueByRatio, X-Value Y-Value W-Value H-Value should be set using ratio value. When the template mode is modified, X-Value Y-Value W-Value H-Value needs to be modified.

Parameters:

template_mode – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationTemplates& the reference of this object.

const std::map<std::string, AssemblyVerificationLayOutArea> &get_areas() const#

Get Areas.

The areas inside the template.The key of the map is the name of area.The value of the map is the parameter of area.

See also

set_areas()

Returns:

const std::map<std::string, AssemblyVerificationLayOutArea> & Areas

AssemblyVerificationTemplates &set_areas(const std::map<std::string, AssemblyVerificationLayOutArea> &areas)#

Set Areas with std::map<std::string, AssemblyVerificationLayOutArea> value.

The areas inside the template.The key of the map is the name of area.The value of the map is the parameter of area.

See also

get_areas()

Parameters:

areas – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationTemplates& the reference of this object.

const AssemblyVerificationLayOutArea &get_areas(const std::string &key) const#

Get value in Areas with key.

Warning

The key must be exist in Areas. otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::map<std::string, AssemblyVerificationLayOutArea> & value in Areas at key.

AssemblyVerificationTemplates &set_areas(const std::string &key, const AssemblyVerificationLayOutArea &value)#

Set value in Areas with key.

Parameters:
  • key – the key to set.

  • value – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationTemplates& the reference of this object.

bool areas_contains(const std::string &key) const#

Check if the key is exist in Areas.

Returns:

bool true if the key is exist in Areas, otherwise false.

size_t get_areas_size() const#

Get the size of Areas.

Returns:

size_t the size of Areas

AssemblyVerificationLayOutArea &get_areas(const std::string &key)#

Get mutable reference of value in Areas with key. A new key and default value will be created if the key does not exist.

Returns:

AssemblyVerificationLayOutArea& the mutable reference of value in Areas at key.

class AssemblyVerificationTrainingParameters : public aidi::param::SchemableParameter#

AssemblyVerificationTrainingParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_epoch() const#

Get Epoch.

Number of epochs to train

See also

set_epoch()

Returns:

int Epoch

AssemblyVerificationTrainingParameters &set_epoch(int epoch)#

Set Epoch with int value.

Number of epochs to train

See also

get_epoch()

Parameters:

epoch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationTrainingParameters& the reference of this object.

int get_batch_size() const#

Get Training Batch Size.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

set_batch_size()

Returns:

int Training Batch Size

AssemblyVerificationTrainingParameters &set_batch_size(int batch_size)#

Set Training Batch Size with int value.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

get_batch_size()

Parameters:

batch_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationTrainingParameters& the reference of this object.

const DataAugmentation &get_augmentations() const#

Get Data Augmentation.

Data Augmentation Parameters

Returns:

const DataAugmentation & Data Augmentation

AssemblyVerificationTrainingParameters &set_augmentations(const DataAugmentation &augmentations)#

Set Data Augmentation with DataAugmentation value.

Data Augmentation Parameters

Parameters:

augmentations – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationTrainingParameters& the reference of this object.

DataAugmentation &get_augmentations()#

Get mutable reference of Data Augmentation.

Data Augmentation Parameters

Returns:

AssemblyVerificationTrainingParameters& the mutable reference of the group.

const AssemblyVerificationMaxInputSize &get_input_shape() const#

Get Input Shape.

Input Shape Parameters

Returns:

const AssemblyVerificationMaxInputSize & Input Shape

AssemblyVerificationTrainingParameters &set_input_shape(const AssemblyVerificationMaxInputSize &input_shape)#

Set Input Shape with AssemblyVerificationMaxInputSize value.

Input Shape Parameters

Parameters:

input_shape – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationTrainingParameters& the reference of this object.

AssemblyVerificationMaxInputSize &get_input_shape()#

Get mutable reference of Input Shape.

Input Shape Parameters

Returns:

AssemblyVerificationTrainingParameters& the mutable reference of the group.

class AssemblyVerificationFilterParameters : public aidi::param::SchemableParameter#

AssemblyVerificationFilterParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

double get_threshold() const#

Get Confidence Threshold.

Keypoints with confidence greater than this threshold will be determined as a character target.

See also

set_threshold()

Returns:

double Confidence Threshold

AssemblyVerificationFilterParameters &set_threshold(double threshold)#

Set Confidence Threshold with double value.

Keypoints with confidence greater than this threshold will be determined as a character target.

See also

get_threshold()

Parameters:

threshold – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationFilterParameters& the reference of this object.

double get_density() const#

Get Search Denisty.

SKeep only one result within the radius of target size * density

See also

set_density()

Returns:

double Search Denisty

AssemblyVerificationFilterParameters &set_density(double density)#

Set Search Denisty with double value.

SKeep only one result within the radius of target size * density

See also

get_density()

Parameters:

density – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

AssemblyVerificationFilterParameters& the reference of this object.

Classification Tool Parameters#

class ClassificationInputShape : public aidi::param::ISchemable#

ClassificationInputShape Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Customize Input Size.

Enable this option to customize the model input shape. With this option enabled, the the input image will be resized into the customized shape before inference it.

See also

set_enable()

Returns:

bool Customize Input Size

ClassificationInputShape &set_enable(bool enable)#

Set Customize Input Size with bool value.

Enable this option to customize the model input shape. With this option enabled, the the input image will be resized into the customized shape before inference it.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationInputShape& the reference of this object.

int get_base_input_width() const#

Get Input Image Width.

Returns:

int Input Image Width

ClassificationInputShape &set_base_input_width(int base_input_width)#

Set Input Image Width with int value.

Parameters:

base_input_width – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationInputShape& the reference of this object.

int get_base_input_height() const#

Get Input Image Height.

Returns:

int Input Image Height

ClassificationInputShape &set_base_input_height(int base_input_height)#

Set Input Image Height with int value.

Parameters:

base_input_height – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationInputShape& the reference of this object.

class ClassificationTrainingParameters : public aidi::param::SchemableParameter#

ClassificationTrainingParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_epoch() const#

Get Epoch.

Number of epochs to train

See also

set_epoch()

Returns:

int Epoch

ClassificationTrainingParameters &set_epoch(int epoch)#

Set Epoch with int value.

Number of epochs to train

See also

get_epoch()

Parameters:

epoch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationTrainingParameters& the reference of this object.

int get_batch_size() const#

Get Training Batch Size.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

set_batch_size()

Returns:

int Training Batch Size

ClassificationTrainingParameters &set_batch_size(int batch_size)#

Set Training Batch Size with int value.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16. The classification module needs to be set larger, generally 32, 64

See also

get_batch_size()

Parameters:

batch_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationTrainingParameters& the reference of this object.

double get_lr_decay() const#

Get Learning Rate Decay.

The learning rate is multiplied by this value every epoch. The larger the value, the faster the learning rate decreases

See also

set_lr_decay()

Returns:

double Learning Rate Decay

ClassificationTrainingParameters &set_lr_decay(double lr_decay)#

Set Learning Rate Decay with double value.

The learning rate is multiplied by this value every epoch. The larger the value, the faster the learning rate decreases

See also

get_lr_decay()

Parameters:

lr_decay – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationTrainingParameters& the reference of this object.

const std::string &get_model_arch() const#

Get Model Architecture.

The Fast-Model is suitable for most scenarios, but the classification accuracy may be reduced in scenarios with more categories (more than 10 categories) and lower differentiation between categories, in which you can use the High-Precision-Model, although this will result in a slightly longer training and inference time.

See also

set_model_arch()

Returns:

const std::string & Model Architecture

ClassificationTrainingParameters &set_model_arch(const std::string &model_arch)#

Set Model Architecture with std::string value.

The Fast-Model is suitable for most scenarios, but the classification accuracy may be reduced in scenarios with more categories (more than 10 categories) and lower differentiation between categories, in which you can use the High-Precision-Model, although this will result in a slightly longer training and inference time.

See also

get_model_arch()

Parameters:

model_arch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationTrainingParameters& the reference of this object.

bool get_with_contrastive() const#

Get With Contrastive Learning.

With this option enabled, The algorithm will try to improve the model performance by comparing the difference between sample and defective image. This mode is only applicable to the mixed images composed of a sample image and a defective image, it’s not applicable to single-image-samples or mixed images composed of different photos of the same defect.

Returns:

bool With Contrastive Learning

ClassificationTrainingParameters &set_with_contrastive(bool with_contrastive)#

Set With Contrastive Learning with bool value.

With this option enabled, The algorithm will try to improve the model performance by comparing the difference between sample and defective image. This mode is only applicable to the mixed images composed of a sample image and a defective image, it’s not applicable to single-image-samples or mixed images composed of different photos of the same defect.

Parameters:

with_contrastive – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationTrainingParameters& the reference of this object.

bool get_small_target() const#

Get Detect Small Target.

Enable this option to detect small target

Returns:

bool Detect Small Target

ClassificationTrainingParameters &set_small_target(bool small_target)#

Set Detect Small Target with bool value.

Enable this option to detect small target

Parameters:

small_target – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationTrainingParameters& the reference of this object.

const DataAugmentation &get_augmentations() const#

Get Data Augmentation.

Data Augmentation Parameters

Returns:

const DataAugmentation & Data Augmentation

ClassificationTrainingParameters &set_augmentations(const DataAugmentation &augmentations)#

Set Data Augmentation with DataAugmentation value.

Data Augmentation Parameters

Parameters:

augmentations – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationTrainingParameters& the reference of this object.

DataAugmentation &get_augmentations()#

Get mutable reference of Data Augmentation.

Data Augmentation Parameters

Returns:

ClassificationTrainingParameters& the mutable reference of the group.

const ClassificationInputShape &get_input_shape() const#

Get Input Shape.

Input Shape Parameters

Returns:

const ClassificationInputShape & Input Shape

ClassificationTrainingParameters &set_input_shape(const ClassificationInputShape &input_shape)#

Set Input Shape with ClassificationInputShape value.

Input Shape Parameters

Parameters:

input_shape – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationTrainingParameters& the reference of this object.

ClassificationInputShape &get_input_shape()#

Get mutable reference of Input Shape.

Input Shape Parameters

Returns:

ClassificationTrainingParameters& the mutable reference of the group.

class ClassificationInferParameters : public aidi::param::SchemableParameter#

ClassificationInferParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_visualize_param() const#

Get Heat map visualization.

Heat map visualization

Returns:

bool Heat map visualization

ClassificationInferParameters &set_visualize_param(bool visualize_param)#

Set Heat map visualization with bool value.

Heat map visualization

Parameters:

visualize_param – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ClassificationInferParameters& the reference of this object.

Detection Tool Parameters#

class DetectionTrainingParameters : public aidi::param::SchemableParameter#

DetectionTrainingParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

int get_epoch() const#

Get Epoch.

Number of epochs to train

See also

set_epoch()

Returns:

int Epoch

DetectionTrainingParameters &set_epoch(int epoch)#

Set Epoch with int value.

Number of epochs to train

See also

get_epoch()

Parameters:

epoch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionTrainingParameters& the reference of this object.

int get_batch_size() const#

Get Training Batch Size.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16.

See also

set_batch_size()

Returns:

int Training Batch Size

DetectionTrainingParameters &set_batch_size(int batch_size)#

Set Training Batch Size with int value.

The number of images involved in training in each iteration of network training. A suitable batch size can make full use of hardware and improve the convergence speed. Common values are 4, 8, and 16.

See also

get_batch_size()

Parameters:

batch_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionTrainingParameters& the reference of this object.

double get_lr_decay() const#

Get Learning Rate Decay.

The learning rate is multiplied by this value every epoch. The larger the value, the faster the learning rate decreases

See also

set_lr_decay()

Returns:

double Learning Rate Decay

DetectionTrainingParameters &set_lr_decay(double lr_decay)#

Set Learning Rate Decay with double value.

The learning rate is multiplied by this value every epoch. The larger the value, the faster the learning rate decreases

See also

get_lr_decay()

Parameters:

lr_decay – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionTrainingParameters& the reference of this object.

const std::string &get_model_arch() const#

Get Model Architecture.

The 108 model only supports single-class detection and is fast with inference,the 110 model supports multi-class detection and more comprehensive reasoning

See also

set_model_arch()

Returns:

const std::string & Model Architecture

DetectionTrainingParameters &set_model_arch(const std::string &model_arch)#

Set Model Architecture with std::string value.

The 108 model only supports single-class detection and is fast with inference,the 110 model supports multi-class detection and more comprehensive reasoning

See also

get_model_arch()

Parameters:

model_arch – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionTrainingParameters& the reference of this object.

const DataAugmentation &get_augmentations() const#

Get Data Augmentation.

Data Augmentation Parameters

Returns:

const DataAugmentation & Data Augmentation

DetectionTrainingParameters &set_augmentations(const DataAugmentation &augmentations)#

Set Data Augmentation with DataAugmentation value.

Data Augmentation Parameters

Parameters:

augmentations – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionTrainingParameters& the reference of this object.

DataAugmentation &get_augmentations()#

Get mutable reference of Data Augmentation.

Data Augmentation Parameters

Returns:

DetectionTrainingParameters& the mutable reference of the group.

int get_max_split() const#

Get Resolution Level.

The short side of the image input will be scaled to (base_size*Resolution Level), and the long side will be scaled proportionally. When the max precision set is higher than the required precision of the algorithm, the precision will be automatically reduced. The applied precision can be acquired from figuration files of the trained model

See also

set_max_split()

Returns:

int Resolution Level

DetectionTrainingParameters &set_max_split(int max_split)#

Set Resolution Level with int value.

The short side of the image input will be scaled to (base_size*Resolution Level), and the long side will be scaled proportionally. When the max precision set is higher than the required precision of the algorithm, the precision will be automatically reduced. The applied precision can be acquired from figuration files of the trained model

See also

get_max_split()

Parameters:

max_split – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionTrainingParameters& the reference of this object.

const DetectionInputShape &get_input_shape() const#

Get Input Shape.

Input Shape Parameters

Returns:

const DetectionInputShape & Input Shape

DetectionTrainingParameters &set_input_shape(const DetectionInputShape &input_shape)#

Set Input Shape with DetectionInputShape value.

Input Shape Parameters

Parameters:

input_shape – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionTrainingParameters& the reference of this object.

DetectionInputShape &get_input_shape()#

Get mutable reference of Input Shape.

Input Shape Parameters

Returns:

DetectionTrainingParameters& the mutable reference of the group.

const DetectionTrainingStrategy &get_train_tricks() const#

Get train tricks.

Detecion Strategy Parameters

Returns:

const DetectionTrainingStrategy & train tricks

DetectionTrainingParameters &set_train_tricks(const DetectionTrainingStrategy &train_tricks)#

Set train tricks with DetectionTrainingStrategy value.

Detecion Strategy Parameters

Parameters:

train_tricks – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionTrainingParameters& the reference of this object.

DetectionTrainingStrategy &get_train_tricks()#

Get mutable reference of train tricks.

Detecion Strategy Parameters

Returns:

DetectionTrainingParameters& the mutable reference of the group.

class DetectionInferParameters : public aidi::param::SchemableParameter#

DetectionInferParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

double get_confidence_threshold() const#

Get Confidence Threshold.

Only retain objects with a confidence score greater than this threshold.

Returns:

double Confidence Threshold

DetectionInferParameters &set_confidence_threshold(double confidence_threshold)#

Set Confidence Threshold with double value.

Only retain objects with a confidence score greater than this threshold.

Parameters:

confidence_threshold – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionInferParameters& the reference of this object.

int get_min_target_size() const#

Get Minimum Target Size.

Only retain objects with a width and height greater than this minimum size.

Returns:

int Minimum Target Size

DetectionInferParameters &set_min_target_size(int min_target_size)#

Set Minimum Target Size with int value.

Only retain objects with a width and height greater than this minimum size.

Parameters:

min_target_size – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionInferParameters& the reference of this object.

int get_max_target_num() const#

Get Maximum Target Count.

Retain only the top N targets with the highest confidence score

Returns:

int Maximum Target Count

DetectionInferParameters &set_max_target_num(int max_target_num)#

Set Maximum Target Count with int value.

Retain only the top N targets with the highest confidence score

Parameters:

max_target_num – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionInferParameters& the reference of this object.

class DetectionTrainingStrategy : public aidi::param::ISchemable#

DetectionTrainingStrategy Parameter class generated by jinja2 automatically.

Detection training tricks

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_auto_anchor() const#

Get Auto Anchor.

Auto anchor will automatically adjust the preset anchor size based on the image label

Returns:

bool Auto Anchor

DetectionTrainingStrategy &set_auto_anchor(bool auto_anchor)#

Set Auto Anchor with bool value.

Auto anchor will automatically adjust the preset anchor size based on the image label

Parameters:

auto_anchor – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionTrainingStrategy& the reference of this object.

class DetectionInputShape : public aidi::param::ISchemable#

DetectionInputShape Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable Custom Input Shape.

Enable to Customize Network Input Shape

See also

set_enable()

Returns:

bool Enable Custom Input Shape

DetectionInputShape &set_enable(bool enable)#

Set Enable Custom Input Shape with bool value.

Enable to Customize Network Input Shape

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionInputShape& the reference of this object.

int get_base_input_width() const#

Get Base Input Width.

Base Input Width

Returns:

int Base Input Width

DetectionInputShape &set_base_input_width(int base_input_width)#

Set Base Input Width with int value.

Base Input Width

Parameters:

base_input_width – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionInputShape& the reference of this object.

int get_base_input_height() const#

Get Base Input Height.

Base Input Height

Returns:

int Base Input Height

DetectionInputShape &set_base_input_height(int base_input_height)#

Set Base Input Height with int value.

Base Input Height

Parameters:

base_input_height – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

DetectionInputShape& the reference of this object.

View Transformer Parameters#

enum aidi::param::ViewTransMode#

Values:

enumerator kByPixel = 0#
enumerator kByRatio = 1#
class ViewFilterParameters : public aidi::param::SchemableParameter#

ViewFilterParameters Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_with_ok_view() const#

Get With OK View.

Treating views with no detection results as detection targets

Returns:

bool With OK View

ViewFilterParameters &set_with_ok_view(bool with_ok_view)#

Set With OK View with bool value.

Treating views with no detection results as detection targets

Parameters:

with_ok_view – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ViewFilterParameters& the reference of this object.

const std::map<std::string, SingleClassPolygonsFilterParamters> &get_keep_classes() const#

Get Keep Classes.

Polygon thresholds (area, side-length,etc.) named with the label classes according to which to filter the polygons.

Returns:

const std::map<std::string, SingleClassPolygonsFilterParamters> & Keep Classes

ViewFilterParameters &set_keep_classes(const std::map<std::string, SingleClassPolygonsFilterParamters> &keep_classes)#

Set Keep Classes with std::map<std::string, SingleClassPolygonsFilterParamters> value.

Polygon thresholds (area, side-length,etc.) named with the label classes according to which to filter the polygons.

Parameters:

keep_classes – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ViewFilterParameters& the reference of this object.

const SingleClassPolygonsFilterParamters &get_keep_classes(const std::string &key) const#

Get value in Keep Classes with key.

Warning

The key must be exist in Keep Classes. otherwise, the behavior is undefined and will cause segmentation fault.

Returns:

const std::map<std::string, SingleClassPolygonsFilterParamters> & value in Keep Classes at key.

ViewFilterParameters &set_keep_classes(const std::string &key, const SingleClassPolygonsFilterParamters &value)#

Set value in Keep Classes with key.

Parameters:
  • key – the key to set.

  • value – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ViewFilterParameters& the reference of this object.

bool keep_classes_contains(const std::string &key) const#

Check if the key is exist in Keep Classes.

Returns:

bool true if the key is exist in Keep Classes, otherwise false.

size_t get_keep_classes_size() const#

Get the size of Keep Classes.

Returns:

size_t the size of Keep Classes

SingleClassPolygonsFilterParamters &get_keep_classes(const std::string &key)#

Get mutable reference of value in Keep Classes with key. A new key and default value will be created if the key does not exist.

Returns:

SingleClassPolygonsFilterParamters& the mutable reference of value in Keep Classes at key.

class ViewTransAutoMask#

ViewTransAutoMask Parameter class generated by jinja2 automatically.

Public Functions

bool get_enable() const#

Get Anable View Auto Mask.

Enable this option to use the detection result from the previous module as a mask.

See also

set_enable()

Returns:

bool Anable View Auto Mask

ViewTransAutoMask &set_enable(bool enable)#

Set Anable View Auto Mask with bool value.

Enable this option to use the detection result from the previous module as a mask.

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ViewTransAutoMask& the reference of this object.

int get_dilate_pixel() const#

Get Dilate Pixel.

Dilate the detection result from the previous module before mask. A negative value indicate erosion operation.

Returns:

int Dilate Pixel

ViewTransAutoMask &set_dilate_pixel(int dilate_pixel)#

Set Dilate Pixel with int value.

Dilate the detection result from the previous module before mask. A negative value indicate erosion operation.

Parameters:

dilate_pixel – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ViewTransAutoMask& the reference of this object.

bool get_reverse_mask() const#

Get Reverse Mask.

Inverse masking of areas in the view that have no detection results from the previous module. Note that this option works after the dilate option if it’s not zero.

Returns:

bool Reverse Mask

ViewTransAutoMask &set_reverse_mask(bool reverse_mask)#

Set Reverse Mask with bool value.

Inverse masking of areas in the view that have no detection results from the previous module. Note that this option works after the dilate option if it’s not zero.

Parameters:

reverse_mask – the value to set.

Returns:

ViewTransAutoMask& the reference of this object.

class ViewTransFormParameter#

ViewTransFormParameter Parameter class generated by jinja2 automatically.

Public Functions

ViewTransMode get_mode() const#

Get Offset Mode.

Offset by a fixed number of pixels or by a percentage depending on the size of the defect.

See also

set_mode()

Returns:

ViewTransMode View Mode

ViewTransFormParameter &set_mode(ViewTransMode mode)#

Set the view transform mode as ByPixel or ByRatio.

Generate view by a fixed number of pixels or by a percentage depending on the size of the defect.

See also

get_mode()

Parameters:

mode – the The View mode.

Returns:

ViewTransFormParameter& the reference of this object.

const geometry::Vector2f &get_offset() const#

Get Offset Vector.

See also

set_offset()

Returns:

The offset vector, Its practical use is determined by the VeiwTransOffsetMode in get_mode()

ViewTransFormParameter &set_offset(const geometry::Vector2f &offset)#

Set View offset vector With the centre of the original test result as the reference coordinate system.

See also

get_offset()

Parameters:

offset – the offset value to set.

Returns:

ViewTransFormParameter& the reference of this object.

const geometry::Size2f &get_window_size() const#

Get Window Size.

The view window size, The meaning of the options is determined by the Window Size Mode

The View window size mode. “DynamicPixel” mode means get the window size from the detection result from previous module and you can scale it with a fixed number of pixels; “DynamicRatio” mode means get the window size from the detection result from previous module and you can scale it by ratio; “FixedWindow” means set the view windows to a fixed size regardless of the size of the detection result from previous module.

Returns:

Window Size or Window expand size base on the detection result.

ViewTransFormParameter &set_window_size(const geometry::Size2f &window_size)#

Set Window size.

The view window size, The meaning of the options is determined by the view mode.

Parameters:

window_size – the value to set.

Returns:

ViewTransFormParameter& the reference of this object.

bool get_fixed_window_size() const#

Get If the view windows size is fixed.

Returns:

bool

ViewTransFormParameter &set_fixed_window_size(bool fixed_window_size)#

Set this option as true to fix the view window size.

Parameters:

fixed_window_size

Returns:

ViewTransFormParameter&

geometry::Radian get_rotate_angle() const#

Get the view rotate angle.

Returns:

geometry::Radian the view rotate angle base on the reference coordinate system.

ViewTransFormParameter &set_rotate_angle(const geometry::Radian &angle)#

Set the view rotate angle.

Parameters:

angle – rotate angle.

Returns:

ViewTransFormParameter& this parameter object.

const ViewTransAutoMask &get_auto_mask() const#

Get Auto View Mask.

Auto view mask parameters

See also

set_auto_mask()

Returns:

const ViewTransAutoMask & Auto View Mask

ViewTransFormParameter &set_auto_mask(const ViewTransAutoMask &auto_mask)#

Set Auto View Mask with ViewTransAutoMask value.

Auto view mask parameters

See also

get_auto_mask()

Parameters:

auto_mask – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ViewTransFormParameter& the reference of this object.

ViewTransAutoMask &get_auto_mask()#

Get mutable reference of Auto View Mask.

Auto view mask parameters

Returns:

ViewTransFormParameter& the mutable reference of the group.

const geometry::MultiPolygon2f &get_manual_mask() const#

Get the manual mask object.

Returns:

const geometry::MultiPolygon2f& Get the manual view mask.

ViewTransFormParameter &set_manual_mask(const geometry::MultiPolygon2f &manual_mask)#

Set the manual mask object.

class ViewTransformParameterList : public aidi::param::IParameter#

Public Functions

size_t size() const#

View transform parameter size.

Returns:

size_t

std::vector<std::string> keys() const#

All view transform parameters’ names.

Returns:

std::vector<std::string> parameter names.

const ViewTransFormParameter &at(const std::string &view_param_name) const#

Get view specified by the name.

Parameters:

view_param_name

Returns:

ViewTransFormParameter const&

bool contains(const std::string &view_param_name) const#

Check if the list contains parameter specified by the name.

Parameters:

view_param_name

Returns:

bool

void erase(const std::string &view_param_name)#

remove parameter from the list.

std::string add(const ViewTransFormParameter &view_param)#

Add a new ViewTransFormParameter instance into this list. An new id will be generated for the parameter added.

Parameters:

view_param – The parameter to be added into this list.

Returns:

std::string The parameter id generated by the list.

void update(const std::string &view_param_name, const ViewTransFormParameter &view_param)#

Update view parameter specified by view_param_name with the new parameter. If parameter specified by view_param_name does not exist, the new ViewTransFormParameter instance will be added into this list with key view_param_name.

Parameters:
  • view_param_name – The key of the parameter to be updated.

  • view_param – The new parameter to be updated.

以下参数项仅为示例#

class ExampleAugRotate : public aidi::param::ISchemable#

ExampleAugRotate Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Enable this augments

See also

set_enable()

Returns:

bool Enable

ExampleAugRotate &set_enable(bool enable)#

Set Enable with bool value.

Enable this augments

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugRotate& the reference of this object.

double get_rotate_angle() const#

Get Rotate Angle.

Rotate angle

Returns:

double Rotate Angle

ExampleAugRotate &set_rotate_angle(double rotate_angle)#

Set Rotate Angle with double value.

Rotate angle

Parameters:

rotate_angle – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugRotate& the reference of this object.

bool get_flip_horizontal() const#

Get Flip Horizontal.

Flip horizontal

Returns:

bool Flip Horizontal

ExampleAugRotate &set_flip_horizontal(bool flip_horizontal)#

Set Flip Horizontal with bool value.

Flip horizontal

Parameters:

flip_horizontal – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugRotate& the reference of this object.

bool get_flip_vertical() const#

Get Flip Vertical.

Flip vertical

Returns:

bool Flip Vertical

ExampleAugRotate &set_flip_vertical(bool flip_vertical)#

Set Flip Vertical with bool value.

Flip vertical

Parameters:

flip_vertical – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugRotate& the reference of this object.

class ExampleAugShift : public aidi::param::ISchemable#

ExampleAugShift Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Enable this augments

See also

set_enable()

Returns:

bool Enable

ExampleAugShift &set_enable(bool enable)#

Set Enable with bool value.

Enable this augments

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugShift& the reference of this object.

double get_shift_width() const#

Get Shift Width.

Shift width

Returns:

double Shift Width

ExampleAugShift &set_shift_width(double shift_width)#

Set Shift Width with double value.

Shift width

Parameters:

shift_width – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugShift& the reference of this object.

double get_shift_height() const#

Get Shift Height.

Shift height

Returns:

double Shift Height

ExampleAugShift &set_shift_height(double shift_height)#

Set Shift Height with double value.

Shift height

Parameters:

shift_height – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugShift& the reference of this object.

class ExampleAugments : public aidi::param::SchemableParameter#

ExampleAugments Parameter class generated by jinja2 automatically.

Public Functions

virtual const std::string &schema_str() const override#

Get the json schema of the class.

Returns:

std::string the json schema string.

virtual const void *schema() const override#

Get nlohmann::json object pointer.

As most user not config the nlohmann::json library, we convert it as void pointer to avoid exposing types from third-party libraries to users.

Note

As this interface is a virtual function, we can not hide it with macro.

Warning

Do not edit return value.

Returns:

void* The nlohmann::json object pointer

bool get_enable() const#

Get Enable.

Enable this augments

See also

set_enable()

Returns:

bool Enable

ExampleAugments &set_enable(bool enable)#

Set Enable with bool value.

Enable this augments

See also

get_enable()

Parameters:

enable – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugments& the reference of this object.

const ExampleAugShift &get_shift() const#

Get Shift.

Shift augments

See also

set_shift()

Returns:

const ExampleAugShift & Shift

ExampleAugments &set_shift(const ExampleAugShift &shift)#

Set Shift with ExampleAugShift value.

Shift augments

See also

get_shift()

Parameters:

shift – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugments& the reference of this object.

ExampleAugShift &get_shift()#

Get mutable reference of Shift.

Shift augments

Returns:

ExampleAugments& the mutable reference of the group.

const ExampleAugRotate &get_rotate() const#

Get Rotate.

Rotate augments

See also

set_rotate()

Returns:

const ExampleAugRotate & Rotate

ExampleAugments &set_rotate(const ExampleAugRotate &rotate)#

Set Rotate with ExampleAugRotate value.

Rotate augments

See also

get_rotate()

Parameters:

rotate – the value to set.

Throws:

aidi::excepts::JsonSchemaValidationError – if validate the value with json schema failed.

Returns:

ExampleAugments& the reference of this object.

ExampleAugRotate &get_rotate()#

Get mutable reference of Rotate.

Rotate augments

Returns:

ExampleAugments& the mutable reference of the group.