Class OpenVINO

Nested Relationships

Nested Types

Class Documentation

class OpenVINO

Support for basic OpenVINO related actions like version identification of neural network blobs,…

Public Types

enum Version

OpenVINO Version supported version information.

Values:

enumerator VERSION_2020_3
enumerator VERSION_2020_4
enumerator VERSION_2021_1
enumerator VERSION_2021_2
enumerator VERSION_2021_3
enumerator VERSION_2021_4
enumerator VERSION_2022_1
enumerator VERSION_UNIVERSAL
enum class Device

Values:

enumerator VPU
enumerator VPUX

Public Static Functions

static std::vector<Version> getVersions()
Returns:

Supported versions

static std::string getVersionName(Version version)

Returns string representation of a given version

Parameters:

versionOpenVINO version

Returns:

Name of a given version

static Version parseVersionName(const std::string &versionString)

Creates Version from string representation. Throws if not possible.

Parameters:

versionStringVersion as string

Returns:

Version object if successful

static std::vector<Version> getBlobSupportedVersions(std::uint32_t majorVersion, std::uint32_t minorVersion)

Returns a list of potentially supported versions for a specified blob major and minor versions.

Parameters:
  • majorVersion – Major version from OpenVINO blob

  • minorVersion – Minor version from OpenVINO blob

Returns:

Vector of potentially supported versions

static Version getBlobLatestSupportedVersion(std::uint32_t majorVersion, std::uint32_t minorVersion)

Returns latest potentially supported version by a given blob version.

Parameters:
  • majorVersion – Major version from OpenVINO blob

  • minorVersion – Minor version from OpenVINO blob

Returns:

Latest potentially supported version

static Version getBlobVersion(std::uint32_t majorVersion, std::uint32_t minorVersion)

Returns OpenVINO version of a given blob minor/major revision.

Parameters:
  • majorVersion – Major version from OpenVINO blob

  • minorVersion – Minor version from OpenVINO blob

Returns:

Latest potentially supported version

static bool areVersionsBlobCompatible(Version v1, Version v2)

Checks whether two blob versions are compatible

Public Static Attributes

static constexpr const Version DEFAULT_VERSION = VERSION_2022_1

Main OpenVINO version.

struct Blob

OpenVINO Blob.

Public Functions

Blob(std::vector<uint8_t> data)

Construct a new Blob from data in memory.

Parameters:

data – In memory blob

Blob(const std::filesystem::path &path)

Construct a new Blob by loading from a filesystem path.

Parameters:

path – Filesystem path to the blob

Public Members

Version version

OpenVINO version.

Device device

Device for which the blob is compiled for.

std::unordered_map<std::string, TensorInfo> networkInputs

Map of input names to additional information.

std::unordered_map<std::string, TensorInfo> networkOutputs

Map of output names to additional information.

uint32_t stageCount = 0

Number of network stages.

uint32_t numShaves = 0

Number of shaves the blob was compiled for.

uint32_t numSlices = 0

Number of CMX slices the blob was compiled for.

std::vector<uint8_t> data

Blob data.

class SuperBlob

A superblob is an efficient way of storing generated blobs for all different number of shaves.

Public Functions

SuperBlob(std::vector<uint8_t> data)

Construct a new SuperBlob object.

Parameters:

data – In memory superblob data

SuperBlob(const std::filesystem::path &pathToSuperBlobFile)

Construct a new SuperBlob object.

Parameters:

pathToSuperBlobFile – Path to the superblob file (.superblob suffix)

dai::OpenVINO::Blob getBlobWithNumShaves(int numShaves)

Generate a blob with a specific number of shaves.

Parameters:

numShaves – Number of shaves to generate the blob for. Must be between 1 and NUMBER_OF_PATCHES.

Returns:

dai::OpenVINO::Blob: Blob compiled for the specified number of shaves

Public Static Attributes

static constexpr size_t NUMBER_OF_PATCHES = 16

Number of patches in a superblob