vitis::ai::Monodepth2 - 3.5 English

Vitis AI Library User Guide (UG1354)

Document ID
UG1354
Release Date
2023-06-29
Version
3.5 English
Base class for Monodepth2 (production segmentation)

Input is an image (cv:Mat).

Output is a struct of segmentation results, named Monodepth2Result.

Sample code :

Mat img = cv::imread("sample_monodepth2.jpg");
auto Monodepth2 = vitis::ai::Monodepth2::create("monodepth2_pt",true);
auto result = Monodepth2->run(img);
// result is structure holding the mat.
std::cout << result.mat.cols <<"\n";

Quick Function Reference

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

Table 1. Quick Function Reference
Type Member Arguments
std::unique_ptr< Monodepth2 > create
  • const std::string & model_name
  • bool need_preprocess
vitis::ai::Monodepth2Result run
  • const cv::Mat & img
std::vector< vitis::ai::Monodepth2Result > run
  • const std::vector< cv::Mat > & imgs
int getInputWidth
  • void
int getInputHeight
  • void
size_t get_input_batch
  • void