Helper Utilities#
-
struct InputHelperOptions#
The options for InputHelper.
Public Members
-
std::string sample_set_name = {}#
The name of sample_set, which will be the name of the main dataset of the project when it is empty or using the default value.
-
std::string input_tool_id = {}#
The Input tool name. If set to empty or using the default value, the importer will automatically look for the name of the Input tool in the project. If there is no Input tool or multiple Input tools in the project, an exception will be thrown. If the given tool name is not empty, you need to ensure that the tool exists and its type is “Input”, otherwise an exception will also be thrown.
-
bool is_auto_deduplication = true#
Whether to remove duplicate images automatically. When this option is set to true, the InputHelper will automatically removes duplicate images that are identical based on the fingerprint of the image, and images that have been previously imported into the dataset will not be re-imported too.
-
util::IProgressCallback *callback = nullptr#
The progress callback for importing the image.
-
size_t parallel_size = 0#
The number of threads to import images in parallel. The default value is 0. When set to 0, the executor will make an intelligent decision on the number of threads to parallelize. Generally, the default value of 0 is sufficient.
-
std::string sample_set_name = {}#
-
class InputHelper#
Utility for helping importing images into Input tool.
The common usage:
Get more option details in the InputHelperOptions.visionflow::helper::InputHelperOptions options; options.input_tool_id = "InputTool"; visionflow::helper::InputHelper helper(project_ptr, options); helper.add_images({image_files_path}); receipts = helper.commit(); for(const auto &receipt : receipts) { if(!receipt.is_success) { std::cout << receipt.error_message << std::endl; } }
Public Functions
-
void add_image(const std::string &image_file)#
Record the image you want to add.
- Parameters:
image_file – An image of a file
-
void add_image(const std::vector<std::string> &image_files)#
Record the image you want to add.
- Parameters:
image_files – An image of multiple files
-
void add_images(const std::vector<std::string> &images_files)#
Record the images you want to add.
- Parameters:
images_files – Multiple images, each consisting of a file.
-
void add_images(const std::vector<std::vector<std::string>> &images_files)#
Record the images you want to add.
- Parameters:
images_files – Multiple images composed of multiple files.
-
const std::vector<InputHelper::Receipt> &commit()#
Adds the currently recorded image to input tool.
Note
1.The image needs to meet the input parameter requirements. 2.When an image is added, channel 4 is converted into channel 3 and channel 2 is converted into channel 1.
- Returns:
const std::vector<InputHelper::Receipt>& Receipt information returned after adding an image.
-
void add_image(const std::string &image_file)#