Operator Types#
-
class IService#
IService interface for Operator.
The IService object will be created before any operator initialize and passed to the operator to provide all required data or save data for init.
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 visionflow::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:
visionflow::Buffer The context buffer saved after the previous execution.
-
virtual bool context_exists() const = 0#
-
class IOperator#
IOperator Interface for Operator.
An Operator is a data processing unit which can be initialized with list of predefined parameters and can generate list of output properties with specific types for each list of input properties of specific types.
Subclassed by visionflow::opers::AssemblyVerificationFilter, visionflow::opers::AssemblyVerificationInfer, visionflow::opers::AssemblyVerificationLabeler, visionflow::opers::AssemblyVerificationObjectMatcher, visionflow::opers::ClassificationInfer, visionflow::opers::ClassificationLabeler, visionflow::opers::ClassificationVisualizer, visionflow::opers::DetectionInfer, visionflow::opers::DetectionLabeler, visionflow::opers::GeometrySearchInfer, visionflow::opers::GeometrySearchLabeler, visionflow::opers::ImageGrabber, visionflow::opers::IntegrationClassifier, visionflow::opers::LocationFilter, visionflow::opers::LocationInfer, visionflow::opers::LocationLabeler, visionflow::opers::LocationObjectMatcher, visionflow::opers::OCRInfer, visionflow::opers::OCRInferStringMatcher, visionflow::opers::OCRLabeler, visionflow::opers::OCRTruthStringMatcher, visionflow::opers::PolygonsFilter, visionflow::opers::RegionsMatcher, visionflow::opers::SegmentationFeatureMapFilter, visionflow::opers::SegmentationInfer, visionflow::opers::SegmentationLabeler, visionflow::opers::SegmentationTRTInfer, visionflow::opers::UnsuperClassificationInfer, visionflow::opers::UnsuperClassificationLabeler, visionflow::opers::UnsuperClassificationTRTInfer, visionflow::opers::UnsuperSegmentationInfer, visionflow::opers::UnsuperSegmentationLabeler, visionflow::opers::UnsuperSegmentationTRTInfer, visionflow::opers::ViewFilter, visionflow::opers::ViewTagger, visionflow::opers::ViewTransformer
Public Types
-
using PropList = std::vector<std::shared_ptr<props::IProperty>>#
Vector of props::IProperty’s shared pointer.
-
using ParamList = std::vector<std::shared_ptr<param::IParameter>>#
Vector of param::IParameter’s shared pointer.
Public Functions
-
IOperator &set_io_ids(std::vector<ToolNodeId> input_ids, std::vector<ToolNodeId> output_ids)#
Set the input and output properties ids.
- Parameters:
input_ids – The input properties ids.
output_ids – The output properties ids.
-
const std::vector<ToolNodeId> &input_prop_ids() const#
Get the input properties ids.
- Returns:
NO_DISCARD input properties ids.
-
const std::vector<ToolNodeId> &output_prop_ids() const#
Get the output properties ids.
- Returns:
NO_DISCARD output properties ids.
-
virtual void initialize(const ParamList ¶m)#
Interface to initialize the operator with the given parameters. The derived class should implement this method initialize(or initialize
(param, service)) to initialize the operator.
- Parameters:
param – List of parameters, all should be derived from param::IParameter.
-
virtual void initialize(const ParamList ¶m, IService &service)#
Interface to initialize the operator with the given parameters and service. The derived class should implement this method(or
initialize(param)) to initialize the operator.
- Parameters:
param – List of parameters, all should be derived from param::IParameter.
service – Help to save data or load data to accelerate initialize.
-
void initialize_with_service(const ParamList ¶m, IService *service = nullptr)#
Interface to initialize the operator with the given parameters and service. it recommend to using this function to init operator instead of initialize.
- Parameters:
param – List of parameters, all should be derived from param::IParameter.
service – Help to save data or load data to accelerate initialize.
-
virtual void execute(ISample &sample) const#
Execute the operator with given sample. By default it dispatches properties to overloaded functions that use a list of properties as arguments.
- Parameters:
sample – [inout] The sample contains the input and output properties.
-
virtual void execute(const PropList &inputs, PropList outputs) const#
Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.
- Parameters:
inputs – [in] List of input properties. All properties in the input list is readonly.
outputs – [out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the
execute
phase, nor can it delete or add a property object, but can only modify the value of each property object.
-
template<typename OperatorType>
inline const OperatorType &as() const# Convert the operator into its derived type. Caller should make sure the type is correct. or std::bad_cast will be thrown.
- Template Parameters:
OperatorType – The derived class of IOperator.
- Returns:
const OperatorType& The derived type of the operator.
-
using PropList = std::vector<std::shared_ptr<props::IProperty>>#
InputTool Operators#
-
class ImageGrabber : public visionflow::opers::IOperator#
Base class of image grabber operator.
Image grabber operator is used to grab image from camera or read image from file.
Subclassed by visionflow::opers::CameraImageGrabber, visionflow::opers::FileImageGrabber
-
class CameraImageGrabber : public visionflow::opers::ImageGrabber#
Image grabber operator for camera.
-
class FileImageGrabber : public visionflow::opers::ImageGrabber#
Image grabber operator for file.
Segmentation Operators#
-
class PolygonsFilter : public visionflow::opers::IOperator#
PolygonsFilter is an operator to filter list of polygon regions with some common thresholds or customized python filter script.
Public Functions
-
virtual void initialize(const IOperator::ParamList ¶m) override#
Interface to initialize the operator with the given parameters. The derived class should implement this method initialize(or initialize
(param, service)) to initialize the operator.
- Parameters:
param – List of parameters, all should be derived from param::IParameter.
-
virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#
Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.
- Parameters:
inputs – [in] List of input properties. All properties in the input list is readonly.
outputs – [out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the
execute
phase, nor can it delete or add a property object, but can only modify the value of each property object.
-
virtual void initialize(const IOperator::ParamList ¶m) override#
-
class SegmentationFeatureMapFilter : public visionflow::opers::IOperator#
Segmentation feature map filter.
Public Functions
-
virtual void initialize(const IOperator::ParamList ¶m) override#
Initialize the SegmentationFeatureMapFilter with param FeatureMapFilterParameters which contains thresholds of each class and dilate pixel factor.
- Parameters:
param – FeatureMapFilterParameters.
-
virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#
Filter the input feature maps of Segmentation with FeatureMapFilterParameters and convert the results into PolygonRegionList.
- Parameters:
inputs – The feature maps of Segmentation.
outputs – The PolygonRegionList of the results after filtering.
- Throws:
excepts::InvalidArgument – Throws if the parameter outputs is not empty.
-
virtual void initialize(const IOperator::ParamList ¶m) override#
-
class SegmentationLabeler : public visionflow::opers::IOperator#
-
class RegionsMatcher : public visionflow::opers::IOperator#
Operator to compare the predicted regions with the ground truth to get the category (in [TP, FP, TN, FN]) of each region.
Public Functions
-
virtual void initialize(const IOperator::ParamList ¶m) override#
Interface to initialize the operator with the given parameters. The derived class should implement this method initialize(or initialize
(param, service)) to initialize the operator.
- Parameters:
param – List of parameters, all should be derived from param::IParameter.
-
virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#
Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.
- Parameters:
inputs – [in] List of input properties. All properties in the input list is readonly.
outputs – [out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the
execute
phase, nor can it delete or add a property object, but can only modify the value of each property object.
-
virtual void initialize(const IOperator::ParamList ¶m) override#
-
class SegmentationInfer : public visionflow::opers::IOperator#
Segmentation inference operator.
-
class SegmentationTRTInfer : public visionflow::opers::IOperator#
Unsuper Segmentation Operators#
-
class UnsuperSegmentationLabeler : public visionflow::opers::IOperator#
-
class UnsuperSegmentationInfer : public visionflow::opers::IOperator#
-
class UnsuperSegmentationTRTInfer : public visionflow::opers::IOperator#
Unsuper Classification Operators#
-
class UnsuperClassificationLabeler : public visionflow::opers::IOperator#
-
class UnsuperClassificationInfer : public visionflow::opers::IOperator#
-
class UnsuperClassificationTRTInfer : public visionflow::opers::IOperator#
OCR Operators#
-
class OCRInfer : public visionflow::opers::IOperator#
OCR common inference operator.
-
class OCRLabeler : public visionflow::opers::IOperator#
-
class OCRInferStringMatcher : public visionflow::opers::IOperator#
OCR infer template matching operator.
-
class OCRTruthStringMatcher : public visionflow::opers::IOperator#
OCR truth template matching operator.
Location Operators#
-
class LocationFilter : public visionflow::opers::IOperator#
NMS and filter operator for Location tool.
-
class LocationInfer : public visionflow::opers::IOperator#
Location common inference operator.
-
class LocationLabeler : public visionflow::opers::IOperator#
-
class LocationObjectMatcher : public visionflow::opers::IOperator#
AssemblyVerification Operators#
-
class AssemblyVerificationFilter : public visionflow::opers::IOperator#
NMS and filter operator for AssemblyVerification tool.
-
class AssemblyVerificationInfer : public visionflow::opers::IOperator#
AssemblyVerification common inference operator.
-
class AssemblyVerificationLabeler : public visionflow::opers::IOperator#
-
class AssemblyVerificationObjectMatcher : public visionflow::opers::IOperator#
Classification Operators#
-
class ClassificationInfer : public visionflow::opers::IOperator#
-
class ClassificationVisualizer : public visionflow::opers::IOperator#
-
class ClassificationLabeler : public visionflow::opers::IOperator#
Detection Operators#
-
class DetectionInfer : public visionflow::opers::IOperator#
-
class DetectionLabeler : public visionflow::opers::IOperator#
GeometrySearch Operators#
-
class GeometrySearchInfer : public visionflow::opers::IOperator#
template match inference operator.
-
class GeometrySearchLabeler : public visionflow::opers::IOperator#
View Transformer Tool#
-
class ViewFilter : public visionflow::opers::IOperator#
ViewFilter is an operator to filter the defect regions by comparing the evaluation factors such as the score, area, side length, x-y axial length with the parameter set by user. ViewFilter can also figure out the views which contains no defect region.
Public Functions
-
virtual void initialize(const IOperator::ParamList ¶m) override#
Interface to initialize the operator with the given parameters. The derived class should implement this method initialize(or initialize
(param, service)) to initialize the operator.
- Parameters:
param – List of parameters, all should be derived from param::IParameter.
-
virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#
Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.
- Parameters:
inputs – [in] List of input properties. All properties in the input list is readonly.
outputs – [out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the
execute
phase, nor can it delete or add a property object, but can only modify the value of each property object.
-
virtual void initialize(const IOperator::ParamList ¶m) override#
-
class ViewTransformer : public visionflow::opers::IOperator#
ViewTransformer is an operator that transforms the result of the previous tool’s detection output with translation, scaling, rotation, masking and other transformation parameters to obtain new view windows that can be used as input to the next tool.
Public Functions
-
virtual void initialize(const IOperator::ParamList ¶m) override#
Interface to initialize the operator with the given parameters. The derived class should implement this method initialize(or initialize
(param, service)) to initialize the operator.
- Parameters:
param – List of parameters, all should be derived from param::IParameter.
-
virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#
Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.
- Parameters:
inputs – [in] List of input properties. All properties in the input list is readonly.
outputs – [out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the
execute
phase, nor can it delete or add a property object, but can only modify the value of each property object.
-
virtual void initialize(const IOperator::ParamList ¶m) override#
Integration Tool#
-
class IntegrationClassifier : public visionflow::opers::IOperator#
Rule-based classifier for integration tool.
Public Functions
-
virtual void initialize(const IOperator::ParamList ¶ms) override#
Interface to initialize the operator with the given parameters. The derived class should implement this method initialize(or initialize
(param, service)) to initialize the operator.
- Parameters:
param – List of parameters, all should be derived from param::IParameter.
-
virtual void initialize(const IOperator::ParamList ¶ms) override#
opers::Factory#
-
class Factory : public visionflow::detail::Factory<Meta, IOperator>, public visionflow::detail::CreatorMutableMixin<Meta, Creator>#
-
using visionflow::opers::Creator = std::function<std::shared_ptr<IOperator>()>#
Operator creator.
General Operator#
-
class ViewTagger : public visionflow::opers::IOperator#
ViewTagger adds tags and split_tag to views by compute CIou of TaggedPolygon and View.
Public Functions
-
virtual void initialize(const IOperator::ParamList ¶m) override#
Interface to initialize the operator with the given parameters. The derived class should implement this method initialize(or initialize
(param, service)) to initialize the operator.
- Parameters:
param – List of parameters, all should be derived from param::IParameter.
-
virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#
Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.
- Parameters:
inputs – [in] List of input properties. All properties in the input list is readonly.
outputs – [out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the
execute
phase, nor can it delete or add a property object, but can only modify the value of each property object.
-
virtual void initialize(const IOperator::ParamList ¶m) override#