vitis::ai::Reid - 1.4.1 English

Vitis AI Library User Guide (UG1354)

Document ID
UG1354
Release Date
2021-12-11
Version
1.4.1 English
Base class for getting feat from an image (cv::Mat).

Input is an image (cv::Mat).

Output image reid feat.

Sample code:

if(argc < 3){
    cerr<<"need two images"<<endl;
    return -1;
}
Mat imgx = imread(argv[1]);
if(imgx.empty()){
    cerr<<"can't load image! "<<argv[1]<<endl;
    return -1;
}
Mat imgy = imread(argv[2]);
if(imgy.empty()){
    cerr<<"can't load image! "<<argv[2]<<endl;
    return -1;
}
auto det = vitis::ai::Reid::create("reid");
Mat featx = det->run(imgx).feat;
Mat featy = det->run(imgy).feat;
double dismat= cosine_distance(featx, featy);
printf("dismat : %.3lf \n", dismat);

Quick Function Reference

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

Table 1. Quick Function Reference
Type Name Arguments
std::unique_ptr< Reid > create
  • const std::string & model_name
  • bool need_preprocess
ReidResult run
  • const cv::Mat & image
std::vector< ReidResult > run
  • const std::vector< cv::Mat > & images
std::vector< ReidResult > run
  • const std::vector< vart::xrt_bo_t > & input_bos