vitis::ai::Covid19Segmentation

Base class for Covid19Segmentation.

Declaration Covid19Segmentation Network Branch positive detection: label0-negative, label1-positive Branch Infected area detection: label0-negative, label1-consolidation, label2-GGO

Input is an image (cv:Mat).

Output is result of running the Covid19Segmentation network.

Quick Function Reference

The following table lists all the functions defined in the vitis::ai::Covid19Segmentation class:

Table 1. Quick Function Reference
TypeNameArguments
std::unique_ptr< Covid19Segmentation >create
  • const std::string & model_name
  • bool need_preprocess
intgetInputWidth
  • void
intgetInputHeight
  • void
size_tget_input_batch
  • void
Covid19SegmentationResultrun_8UC1
  • const cv::Mat & image
std::vector< Covid19SegmentationResult >run_8UC1
  • const std::vector< cv::Mat > & images
Covid19SegmentationResultrun_8UC3
  • const cv::Mat & image
std::vector< Covid19SegmentationResult >run_8UC3
  • const std::vector< cv::Mat > & images

create

Factory function to get an instance of derived classes of class Covid19Segmentation.

Prototype

std::unique_ptr< Covid19Segmentation > create(const std::string &model_name, bool need_preprocess=true);

Parameters

The following table lists the create function arguments.

Table 2. create 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 of Covid19Segmentation class.

getInputWidth

Function to get InputWidth of the covid19segmentation network (input image columns).

Prototype

int getInputWidth() const =0;

Returns

InputWidth of the covid19segmentation network.

getInputHeight

Function to get InputHeight of the covid19segmentation network (input image rows).

Prototype

int getInputHeight() const =0;

Returns

InputHeight of the covid19segmentation network.

get_input_batch

Function to get the number of images processed by the DPU at one time.

Note: Different DPU core the batch size may be different. This depends on the IP used.

Prototype

size_t get_input_batch() const =0;

Returns

Batch size.

run_8UC1

Function to get running result of the covid19segmentation network.

Note: The type of CV_8UC1 of the covid19segmentation result.

Prototype

Covid19SegmentationResult run_8UC1(const cv::Mat &image)=0;

Parameters

The following table lists the run_8UC1 function arguments.

Table 3. run_8UC1 Arguments
Type Name Description
const cv::Mat & image Input data of input image (cv::Mat).

Returns

Covid19segmentation output data.

run_8UC1

Function to get running results of the covid19segmentation neuron network in batch mode.

Note: The type of CV_8UC1 of the covid19segmentation result.

Prototype

std::vector< Covid19SegmentationResult > run_8UC1(const std::vector< cv::Mat > &images)=0;

Parameters

The following table lists the run_8UC1 function arguments.

Table 4. run_8UC1 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 of Covid19segmentationResult.

run_8UC3

Function to get running result of the covid19segmentation network.

Note: The type of CV_8UC3 of the covid19segmentation result.

Prototype

Covid19SegmentationResult run_8UC3(const cv::Mat &image)=0;

Parameters

The following table lists the run_8UC3 function arguments.

Table 5. run_8UC3 Arguments
Type Name Description
const cv::Mat & image Input data of input image (cv::Mat).

Returns

Covid19segmentation image and shape.

run_8UC3

Function to get running results of the covid19segmentation neuron network in batch mode.

Note: The type of CV_8UC3 of the Result's covid19segmentation.

Prototype

std::vector< Covid19SegmentationResult > run_8UC3(const std::vector< cv::Mat > &images)=0;

Parameters

The following table lists the run_8UC3 function arguments.

Table 6. run_8UC3 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 of Covid19SegmentationResult.