Base class for detecting objects in the input image (cv::Mat).
Input is an image (cv::Mat).
Output is the position of the pedestrians in the input image.
Sample code:
auto yolo = vitis::ai::YOLOvX::create
("yolovx_pt", true);
Mat img = cv::imread("sample_yolovx.jpg");
auto results = yolo->run(img);
for (auto& result : results.bboxes) {
int label = result.label;
auto& box = result.box;
cout << "RESULT: " << label << "\t" << std::fixed << std::setprecision(2)
<< box[0] << "\t" << box[1] << "\t" << box[2] << "\t" << box[3] << "\t"
<< std::setprecision(6) << result.score << "\n";
rectangle(img, Point(box[0], box[1]), Point(box[2], box[3]),
Scalar(0, 255, 0), 1, 1, 0);
}
imwrite("result.jpg", img);
Quick Function Reference
The following table lists all the functions defined in the vitis::ai::YOLOvX
class:
Type | Member | Arguments |
---|---|---|
std::unique_ptr<
YOLOvX
> |
create |
|
std::unique_ptr<
YOLOvX
> |
create |
|
YOLOvXResult
|
run |
|
std::vector<
YOLOvXResult
> |
run |
|