vitis::ai::Monodepth2 - 3.5 简体中文

Vitis AI Library 用户指南 (UG1354)

Document ID
UG1354
Release Date
2023-06-29
Version
3.5 简体中文
此基本类对应 Monodepth2 (量产分割)

输入为图像 (cv:Mat)。

输出是分割结果的结构体,名为 Monodepth2Result。

代码样本:

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";

函数快速参考

下表列出了 vitis::ai::Monodepth2 类中定义的所有函数:

表 1. 函数快速参考
类型 成员 实参
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