Base class for detecting objects in the input image(cv::Mat). Input is an image(cv::Mat). Output is the position of the objects in the input image. Sample code:
auto model = vitis::ai::BEVdet::create
(argv[1], argv[2], argv[3]);
std::vector<std::string> names;
LoadImageNames(argv[4], names);
std::vector<cv::Mat> images;
for (auto&& i : names) {
images.emplace_back(cv::imread(i));
}
std::vector<std::vector<char>> bins;
std::vector<std::string> bin_names;
LoadImageNames(argv[5], bin_names);
for (auto&& i : bin_names) {
auto infile = std::ifstream(i, std::ios_base::binary);
bins.emplace_back(std::vector<char>(std::istreambuf_iterator<char>(infile),
std::istreambuf_iterator<char>()));
}
std::vector<vitis::ai::CenterPointResult> res;
res = model->run(images, bins);
for (size_t i = 0; i < 32 && i < res.size(); i++) {
const auto& r = res[i];
cout << "label: " << r.label << " score: " << r.score
<< " bbox: " << r.bbox[0] << " " << r.bbox[1] << " " << r.bbox[2]
<< " " << r.bbox[3] << " " << r.bbox[4] << " " << r.bbox[5] << " "
<< r.bbox[6] << " " << r.bbox[7] << " " << r.bbox[8] << endl;
}
Quick Function Reference
The following table lists all the functions defined in the vitis::ai::BEVdet
class:
Type | Member | Arguments |
---|---|---|
std::unique_ptr< BEVdet > |
create |
|
std::vector<
CenterPointResult
> |
run |
|