vitis::ai::PlateNum
Input is a plate image (cv::Mat).
Output is the number and color of plate in the input image.
sample code:
cv::Mat image = cv::imread("plate.jpg");
auto network = vitis::ai::PlateNum::create(true);
auto r = network->run(image);
auto plate_number = r.plate_number;
auto plate_color = r.plate_color;
Quick Function Reference
The following table lists all the functions defined in the vitis::ai::PlateNum
class:
Type | Name | Arguments |
---|---|---|
std::unique_ptr< PlateNum > | create |
|
std::unique_ptr< PlateNum > | create |
|
PlateNum |
| |
PlateNum |
| |
PlateNum & | operator= |
|
~PlateNum |
| |
int | getInputWidth |
|
int | getInputHeight |
|
size_t | get_input_batch |
|
PlateNumResult | run |
|
std::vector< PlateNumResult > | run |
|
create
Factory function to get an instance of derived classes of class PlateNum
.
Prototype
std::unique_ptr< PlateNum
> create(const std::string &model_name, bool need_mean_scale_process=true);
Parameters
The following table lists the create
function arguments.
Type | Name | Description |
---|---|---|
bool | need_mean_scale_process | normalize with mean/scale or not, true by default. |
Returns
An instance ofPlateNum
class. create
Prototype
std::unique_ptr< PlateNum
> create(const std::string &model_name, xir::Attrs *attrs, bool need_mean_scale_process=true);
PlateNum
Prototype
PlateNum();
PlateNum
Prototype
PlateNum(const PlateNum &)=delete;
operator=
Prototype
PlateNum
& operator=(const PlateNum &)=delete;
~PlateNum
Prototype
~PlateNum();
getInputWidth
Function to get InputWidth of the platenum network (input image columns).
Prototype
int getInputWidth() const =0;
Returns
InputWidth of the platenum network.getInputHeight
Function to get InputHeight of the platenum network (input image rows).
Prototype
int getInputHeight() const =0;
Returns
InputHeight of the platenum 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 =0;
Returns
Batch size.run
Function of get running result of platenum network.
Prototype
PlateNumResult
run(const cv::Mat &img)=0;
Parameters
The following table lists the run
function arguments.
Type | Name | Description |
---|---|---|
const cv::Mat & | img | Input data of input image (cv::Mat) and resized as InputWidth and IntputHeight. |
Returns
The plate number and plate color.run
Function to get running results of the platenum neuron network in batch mode.
Prototype
std::vector< PlateNumResult
> run(const std::vector< cv::Mat > &imgs)=0;
Parameters
The following table lists the run
function arguments.
Type | Name | Description |
---|---|---|
const std::vector< cv::Mat > & | imgs | Input data of input images (std:vector<cv::Mat>). The size of input images equals batch size obtained by get_input_batch. The input images need to be resized to InputWidth and InputHeight required by the network. |