Exemplo n.º 1
0
import os
import pytest
from sys import platform
import numpy as np
from pathlib import Path

from openvino.inference_engine import IENetwork, IECore, ExecutableNetwork
from conftest import model_path, plugins_path, model_onnx_path, model_prototxt_path

test_net_xml, test_net_bin = model_path()
test_net_onnx = model_onnx_path()
test_net_prototxt = model_prototxt_path()
plugins_xml, plugins_win_xml, plugins_osx_xml = plugins_path()


def test_init_ie_core_no_cfg():
    ie = IECore()
    assert isinstance(ie, IECore)


def test_init_ie_core_with_cfg():
    ie = IECore(plugins_xml)
    assert isinstance(ie, IECore)


def test_get_version(device):
    ie = IECore()
    version = ie.get_versions(device)
    assert isinstance(version, dict), "Returned version must be a dictionary"
    assert device in version, "{} plugin version wasn't found in versions"
    assert hasattr(version[device],
Exemplo n.º 2
0
def test_read_network_from_onnx():
    ie = IECore()
    net = ie.read_network(model=model_onnx_path())
    assert isinstance(net, IENetwork)