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
类中定义的所有函数:
类型 | 成员 | 实参 |
---|---|---|
std::unique_ptr< Monodepth2 > | create |
|
vitis::ai::Monodepth2Result | run |
|
std::vector< vitis::ai::Monodepth2Result > | run |
|
int | getInputWidth |
|
int | getInputHeight |
|
size_t | get_input_batch |
|