vitis::ai::VehicleClassification - 3.5 English

Vitis AI Library User Guide (UG1354)

Document ID
Release Date
3.5 English
Base class for detecting objects in the input image (cv::Mat).

Input is an image (cv::Mat).

Output is index and score of objects in the input image.

Sample code:

auto image = cv::imread("sample_vehicleclassification.jpg");
auto network = vitis::ai::VehicleClassification::create(
auto result = network->run(image);
for (const auto &r : result.scores) {
   auto score = r.score;
   auto index = result.lookup(r.index);

Quick Function Reference

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

Table 1. Quick Function Reference
Type Member Arguments
std::unique_ptr< VehicleClassification > create
  • const std::string & model_name
  • bool need_preprocess
vitis::ai::VehicleClassificationResult run
  • const cv::Mat & image
std::vector< vitis::ai::VehicleClassificationResult > run
  • const std::vector< cv::Mat > & images