vitis::ai::MultiTask8UC3
Input is an image (cv::Mat).
Output is struct MultiTaskResult
include segmentation results, detection results and vehicle orientation; The result cv::Mat type is CV_8UC3
Sample code:
auto det = vitis::ai::MultiTask8UC3::create(vitis::ai::MULITASK);
auto image = cv::imread("sample_multitask.jpg");
auto result = det->run(image);
cv::imwrite("res.jpg",result.segmentation);
Quick Function Reference
The following table lists all the functions defined in the vitis::ai::MultiTask8UC3
class:
Type | Name | Arguments |
---|---|---|
std::unique_ptr< MultiTask8UC3 > | create |
|
int | getInputWidth |
|
int | getInputHeight |
|
size_t | get_input_batch |
|
MultiTaskResult | run |
|
std::vector< MultiTaskResult > | run |
|
create
Factory function to get an instance of derived classes of class MultiTask8UC3
.
Prototype
std::unique_ptr< MultiTask8UC3
> create(const std::string &model_name, bool need_preprocess=true);
Parameters
The following table lists the create
function arguments.
Type | Name | Description |
---|---|---|
const std::string & | model_name | Model name |
bool | need_preprocess | Normalize with mean/scale or not, default value is true. |
Returns
An instance ofMultiTask8UC3
class. getInputWidth
Function to get InputWidth of the multitask network (input image columns).
Prototype
int getInputWidth() const;
Returns
InputWidth of the multitask network.getInputHeight
Function to get InputHeight of the multitask network (input image rows).
Prototype
int getInputHeight() const;
Returns
InputHeight of the multitask network.get_input_batch
Function to get the number of images processed by the DPU at one time.
Prototype
size_t get_input_batch() const;
Returns
Batch size.run
Function of get running result from the MultiTask
network.
MultiTaskResult.segmentation
.Prototype
MultiTaskResult
run(const cv::Mat &image);
Parameters
The following table lists the run
function arguments.
Type | Name | Description |
---|---|---|
const cv::Mat & | image | Input image |
Returns
The struct ofMultiTaskResult
run
Function to get running results of the MultiTask
neuron network in batch mode.
MultiTaskResult.segmentation
.Prototype
std::vector< MultiTaskResult
> run(const std::vector< cv::Mat > &images);
Parameters
The following table lists the run
function arguments.
Type | Name | Description |
---|---|---|
const std::vector< cv::Mat > & | images | Input data of input images (std:vector<cv::Mat>). The size of input images equals batch size obtained by get_input_batch. |
Returns
The vector ofMultiTaskResult
.