C++中测试OpenVINO以及相关库是否配置好的方式

2022-01-18  本文已影响0人  LabVIEW_Python

在开发C++ OpenVINO推理程序之前,第一步,就是要把OpenVINO以及相关库配置好。
本例的运行环境:Windows10 + Visual Studio 2019
测试代码:

#include<string>
#include<map>
#include<vector>
#include<iostream>
#include<inference_engine.hpp>

using namespace InferenceEngine;

inline std::ostream& operator<<(std::ostream& os, const InferenceEngine::Version& version) {
    os << "\t" << version.description << " version ......... ";
    os << IE_VERSION_MAJOR << "." << IE_VERSION_MINOR << "." << IE_VERSION_PATCH;

    os << "\n\tBuild ........... ";
    os << version.buildNumber;

    return os;
}

inline std::ostream& operator<<(std::ostream& os, const InferenceEngine::Version* version) {
    if (nullptr != version) {
        os << std::endl << *version;
    }
    return os;
}

inline std::ostream& operator<<(std::ostream& os, const std::map<std::string, InferenceEngine::Version>& versions) {
    for (auto&& version : versions) {
        os << "\t" << version.first << std::endl;
        os << version.second << std::endl;
    }

    return os;
}

int main(void)
{
    Core ie;
    std::cout << ie.GetVersions("CPU") << std::endl;
    return 0;
}

编译后,请添加openvino 库路径到path,并置于path开始;可用echo %path%查阅


添加openvino 库路径到path

调试心得:

上一篇 下一篇

猜你喜欢

热点阅读