Base class for detecting traffic lane for CULane dataset.
Input is an image (cv:Mat).
Output is a struct of detection results, named UltraFastResult
.
Sample code :
Mat img = cv::imread("sample_ultrafast.jpg");
auto ultrafast = vitis::ai::UltraFast::create
("ultrafast_pt",true);
auto results = ultrafast->run(img);
for(const auto &lanes : results.lanes){
std::cout <<"lane:\n";
for(auto &v: lanes) {
std::cout << " ( " << v.first << ", " << v.second << " )\n";
}
}
Display of the model results:
Figure 1. detection result
Quick Function Reference
The following table lists all the functions defined in the vitis::ai::UltraFast
class:
Type | Name | Arguments |
---|---|---|
std::unique_ptr< UltraFast > |
create |
|
vitis::ai::UltraFastResult
|
run |
|
std::vector< vitis::ai::UltraFastResult > |
run |
|
int | getInputWidth |
|
int | getInputHeight |
|
size_t | get_input_batch |
|