Blob manager

BlobManager is a class that is made to help you with downloading neural networks as MyriadX blobs.

Getting started

BlobManager is very easy and straight forward to use. We declare it and pass which project we want to use as it’s argument. Manager supports all models in both Open Model Zoo and our Model zoo. By using configPath and zooDir when initializing the BlobManager you can specify a path to a custom model zoo (path can contain both already compiled blobs and model yml files), which will compile a new blob or read an existing blob. BlobManager is able to reuse existing blobs, download models from model zoo and compile custom models based on yml config.

1from depthai_sdk.managers import BlobManager
2
3# define project that you wish to run
4bm = BlobManager(zooName="face-detection-retail-0004")

After that, the blob is stored in our variable and we can then pass it to our NNetManager, as we will see in the next tutorial, or use it in any other project that we wish.

class depthai_sdk.managers.BlobManager

Manager class that handles MyriadX blobs.

__init__(blobPath=None, configPath=None, zooName=None, zooDir=None, progressFunc=None)
Parameters
  • blobPath (pathlib.Path, Optional) – Path to the compiled MyriadX blob file

  • configPath (pathlib.Path, Optional) – Path to model config file that is used to download the model

  • zooName (str, Optional) – Model name to be taken from model zoo

  • zooDir (pathlib.Path, Optional) – Path to model zoo directory

  • progressFunc (func, Optional) – Custom method to show download progress, should accept two arguments - current bytes and max bytes.

getBlob(shaves=6, openvinoVersion=None, zooType=None)

This function is responsible for returning a ready to use MyriadX blob once requested. It will compile the model automatically using our online blobconverter tool. The compilation process will be ran only once, each subsequent call will return a path to previously compiled blob

Parameters
  • shaves (int, Optional) – Specify how many shaves the model will use. Range 1-16

  • openvinoVersion (depthai.OpenVINO.Version, Optional) – OpenVINO version which will be used to compile the MyriadX blob

  • zooType (str, Optional) – Specifies model zoo type to download blob from

Returns

Path to compiled MyriadX blob

Return type

pathlib.Path

Raises
  • SystemExit – If model name is not found in the zoo, this method will print all available ones and terminate

  • RuntimeError – If conversion failed with unknown status

  • Exception – If some unknown error will occur (reraise)