Configurator Types#

IConfigurator#

class IConfigurator#

Configurator interface.

Subclassed by aidi::confs::BaseColorConf, aidi::confs::ClassificationInferConf, aidi::confs::ClassificationTrainer, aidi::confs::ClassificationTrainerConf, aidi::confs::CustomConf, aidi::confs::DetectionInferConf, aidi::confs::DetectionTrainer, aidi::confs::DetectionTrainerConf, aidi::confs::FeatureMapFilterConf, aidi::confs::GlobalMaskConf, aidi::confs::ImageMeanConf, aidi::confs::InferenceBatchSizeConf, aidi::confs::InputImageConf, aidi::confs::LabelClassesConf, aidi::confs::LocationFeatureFilterConf, aidi::confs::LocationTemplateConf, aidi::confs::LocationTrainer, aidi::confs::LocationTrainerConf, aidi::confs::MatchResultCounterConf, aidi::confs::OCRFeatureFilterConf, aidi::confs::OCRInferConf, aidi::confs::OCRTemplateConf, aidi::confs::OCRTrainer, aidi::confs::OCRTrainerConf, aidi::confs::PolygonsFilterConf, aidi::confs::RegionMatchResultCounter, aidi::confs::RegionsMatcherConf, aidi::confs::SegmentationTrainer, aidi::confs::SegmentationTrainerConf, aidi::confs::TRTCalibrator, aidi::confs::TRTCalibratorConf, aidi::confs::TRTFloatConverter, aidi::confs::TRTInt8Converter, aidi::confs::ViewFilterConf, aidi::confs::ViewTransformerConf

Public Functions

virtual void initialize(const IService &service)#

Interface to initialize the configurator.

You can initialize the configurator with context, parameters and properties set provided by the service object through the service interface IService::load_context(), IService::input_parameters() and IService::property_sets()

Parameters:

service – The Configurator service. see IService for more details.

virtual TaskStatus execute(IService &service)#

Interface to execute the configurator to generate output parameters.

In this inferface, you can execute your configure process and call IService::on_progress to report the progress. After the configure process success, you can call IService::save_context and IService::output_parameters to save the context and output parameters in this method.

The framework will call this method after the initialize method, but it’s not guaranteed this method will always be called after the initialize and before destroy.

We do not recommend you change the configurator member variables in this method although the interface is not limited. In principle, you’d better make the necessary changes in the initialization interface as much as possible.

Parameters:

service – The Configurator service. see IService for more details.

Returns:

TaskStatus The code status of the configurator’s execute result.

template<typename ConfiguratorType>
inline const ConfiguratorType &as() const#

Convert the abstract configurator to a concrete configurator.

Template Parameters:

ConfiguratorType – The concrete configurator type.

Returns:

const ConfiguratorType& The concrete configurator.

template<typename ConfiguratorType>
inline ConfiguratorType &as()#

Convert the abstract configurator to a concrete configurator.

Template Parameters:

ConfiguratorType – The concrete configurator type.

Returns:

ConfiguratorType& The concrete configurator.

IService#

class IService#

Service interface for configurator.

The service object will be created before any configutator initialize and passed to the configurator to provide all required data for configure. At the end of the configure process, the service will be call to save the context and output parameters generated by the configurator.

Subclassed by aidi::ConfigureRuntimeProjectAdapter

Public Types

using ParamList = std::vector<std::shared_ptr<param::IParameter>>#

Vector of param::IParameter’s shared pointer.

using ParamRefList = std::vector<std::reference_wrapper<param::IParameter>>#

Vector of param::IParameter.

Public Functions

virtual bool context_exists() const = 0#

Check if previous context exists or not.

Returns:

true if previous context exists.

Returns:

false if previous context not exists.

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

Get Context saved after the previous execution, which will be empty if it’s the first execution or the previous execution has not saved any context. You can call context_exists() to check if context exists before get it.

Returns:

aidi::Buffer The context buffer saved after the previous execution.

virtual void save_context(const Buffer &context) = 0#

Save current configurator context.

After the configure process success, you can call this method to save current context which maybe useful for the next execution.

Parameters:

context – The curretn configurator context.

virtual ParamList input_parameters() const = 0#

Get the input parameters required by the configurator.

Returns:

ParamList The input parameters required by the configurator.

virtual std::vector<const data::IReadOnlyPropertySet*> property_sets() const = 0#

Get the property set vector required by the configurator.

Returns:

std::vector<data::IReadOnlyPropertySet*> The property set vector required by the configurator.

virtual void output_parameters(const ParamRefList &params) = 0#

Save the output parameters generated by the configurator through the service.

Parameters:

params – The output parameters generated by the configurator.

virtual TaskCtrlSignal on_progress(int total, int progress, const std::string &progress_info) = 0#

Report the configure process status.

Parameters:
  • total – The total number of configure process. You can set total to 0 if you don’t know the total number, and -1 when error happens.

  • progress – The current progress of the configure process. You should make sure that progress is greater than 0 and less than or equal to total if total is not 0 and -1.

  • progress_info – The current progress message, formatted as json, content format like (Note that not all fields exist in the content):

    {
         "Loss": {
             "nacc": 0.704343,
             "pacc": 0.912434
         },
         "Time Left": 189.24,
         "Message": "Some string"
    }
    

Returns:

TaskCtrlSignal Signal to control the task.

template<typename ParamTypes>
inline auto input_parameters() const#

Get the input parameters object and convert input parameters abstract pointer to concrete parameter pointer.

Template Parameters:

ParamTypes – The required input parameters type.

Returns:

tuple of parameter’s shared pointer with concrete type.

template<typename InputProps>
inline auto property_sets() const#

Get the property set vector required by the configurator.

Template Parameters:

InputProps – The required input property types.

Returns:

std::vector<data::IReadOnlyPropertySet*> The property set vector required by the configurator.

confs::Factory#

class Factory : public aidi::detail::Factory<Meta, IConfigurator>, public aidi::detail::CreatorMutableMixin<Meta, Creator>#
struct Meta#

Configurator Meta info.

using aidi::confs::Creator = std::function<std::shared_ptr<IConfigurator>()>#

Configurator creator.

CustomConf#

class CustomConf : public aidi::confs::IConfigurator#

Base Configurator class to generate any user-defined parameters.

This class is a virtual node symbol for the stream graph with no meaningful implementation. You can inherit this class and implement the your own logic to generate the parameters, and register it to the Factory. Or you can also generate the parameters by yourself without this class.

InputImageConf#

class InputImageConf : public aidi::confs::IConfigurator#

Configurator class to generate input image parameter.

LabelClassesConf#

class LabelClassesConf : public aidi::confs::IConfigurator#

Configurator class to generate label classes parameter.

BaseColorConf#

class BaseColorConf : public aidi::confs::IConfigurator#

Configurator to config input images’ base color.

SegmentationTrainerConf#

class SegmentationTrainerConf : public aidi::confs::IConfigurator#

Configurator to set Segmentation module trainer options.

InferenceConf#

class InferenceBatchSizeConf : public aidi::confs::IConfigurator#

Configurator to set inference input batch size.

TRTCalibratorConf#

class TRTCalibratorConf : public aidi::confs::IConfigurator#

Configurator to set TRTCalibrator’s params.

TRTCalibrator#

class TRTCalibrator : public aidi::confs::IConfigurator#

TensorRT Int8 Calibrator.

TRTFloatConverter#

class TRTFloatConverter : public aidi::confs::IConfigurator#

Configurator to convert model into TensortRT float model.

TRTInt8Converter#

class TRTInt8Converter : public aidi::confs::IConfigurator#

Configurator to convert model into TensortRT int8 model.

FeatureMapFilterConf#

class FeatureMapFilterConf : public aidi::confs::IConfigurator#

Configurator to filter FeatureMap.

PolygonsFilterConf#

class PolygonsFilterConf : public aidi::confs::IConfigurator#

Configurator to filter Polygons.

RegionsMatcherConf#

class RegionsMatcherConf : public aidi::confs::IConfigurator#

Configurator to evaluate the model’s statistical information.

MatchResultCounterConf#

class MatchResultCounterConf : public aidi::confs::IConfigurator#

ImageMeanConf#

class ImageMeanConf : public aidi::confs::IConfigurator#

ImageMeanConf Configurator class to compute the image mean values in the views.

Public Functions

virtual void initialize(const IService &service) override#

Interface to initialize the configurator.

You can initialize the configurator with context, parameters and properties set provided by the service object through the service interface IService::load_context(), IService::input_parameters() and IService::property_sets()

Parameters:

service – The Configurator service. see IService for more details.

virtual TaskStatus execute(IService &service) override#

Interface to execute the configurator to generate output parameters.

In this inferface, you can execute your configure process and call IService::on_progress to report the progress. After the configure process success, you can call IService::save_context and IService::output_parameters to save the context and output parameters in this method.

The framework will call this method after the initialize method, but it’s not guaranteed this method will always be called after the initialize and before destroy.

We do not recommend you change the configurator member variables in this method although the interface is not limited. In principle, you’d better make the necessary changes in the initialization interface as much as possible.

Parameters:

service – The Configurator service. see IService for more details.

Returns:

TaskStatus The code status of the configurator’s execute result.

GlobalMaskConf#

class GlobalMaskConf : public aidi::confs::IConfigurator#

Configurator to generate the global mask or other binary/complex training parameters.

RegionMatchResultCounter#

class RegionMatchResultCounter : public aidi::confs::IConfigurator#

A configurator to count region match results.

Public Functions

virtual void initialize(const IService &service) override#

Interface to initialize the configurator.

You can initialize the configurator with context, parameters and properties set provided by the service object through the service interface IService::load_context(), IService::input_parameters() and IService::property_sets()

Parameters:

service – The Configurator service. see IService for more details.

virtual TaskStatus execute(IService &service) override#

Interface to execute the configurator to generate output parameters.

In this inferface, you can execute your configure process and call IService::on_progress to report the progress. After the configure process success, you can call IService::save_context and IService::output_parameters to save the context and output parameters in this method.

The framework will call this method after the initialize method, but it’s not guaranteed this method will always be called after the initialize and before destroy.

We do not recommend you change the configurator member variables in this method although the interface is not limited. In principle, you’d better make the necessary changes in the initialization interface as much as possible.

Parameters:

service – The Configurator service. see IService for more details.

Returns:

TaskStatus The code status of the configurator’s execute result.

SegmentationTrainer#

class SegmentationTrainer : public aidi::confs::IConfigurator#

Configurator to train segmentation model.

OCRTrainer#

class OCRTrainer : public aidi::confs::IConfigurator#

OCR model trainer.

OCRFeatureFilterConf#

class OCRFeatureFilterConf : public aidi::confs::IConfigurator#

LocationFeatureFilterConf#

class LocationFeatureFilterConf : public aidi::confs::IConfigurator#

aidi::confs::OCRInferConf#

class OCRInferConf : public aidi::confs::IConfigurator#

OCR inference parameters’ configurator.

aidi::confs::OCRTemplateConf#

class OCRTemplateConf : public aidi::confs::IConfigurator#

aidi::confs::OCRTrainerConf#

class OCRTrainerConf : public aidi::confs::IConfigurator#

Configurator to set OCR module trainer options.

aidi::confs::LocationTemplateConf#

class LocationTemplateConf : public aidi::confs::IConfigurator#

aidi::confs::LocationTrainer#

class LocationTrainer : public aidi::confs::IConfigurator#

Location Tool model trainer.

aidi::confs::LocationTrainerConf#

class LocationTrainerConf : public aidi::confs::IConfigurator#

Configurator to set Locaiton module trainer options.

aidi::confs::ClassificationInferConf#

class ClassificationInferConf : public aidi::confs::IConfigurator#

Classification inference parameters’ configurator.

aidi::confs::ClassificationTrainerConf#

class ClassificationTrainerConf : public aidi::confs::IConfigurator#

Configurator to set Classification module trainer options.

aidi::confs::ClassificationTrainer#

class ClassificationTrainer : public aidi::confs::IConfigurator#

aidi::confs::DetectionInferConf#

class DetectionInferConf : public aidi::confs::IConfigurator#

Detection inference parameters’ configurator.

aidi::confs::DetectionTrainer#

class DetectionTrainer : public aidi::confs::IConfigurator#

aidi::confs::DetectionTrainerConf#

class DetectionTrainerConf : public aidi::confs::IConfigurator#

Configurator to set Detection module trainer options.

aidi::confs::ViewFilterConf#

class ViewFilterConf : public aidi::confs::IConfigurator#

Configurator to config the filter parameter before view transformer.

aidi::confs::ViewTransformerConf#

class ViewTransformerConf : public aidi::confs::IConfigurator#

Configurator to config the view transformer.