otx.core.data.caching#

Module for data caching.

Functions

init_arrow_cache(dataset[, scheme])

Init arrow format cache from Datumaro.

Classes

MemCacheHandlerSingleton()

A singleton class to create, delete and get MemCacheHandlerBase.

Exceptions

MemCacheHandlerError

Exception class for MemCacheHandler.

exception otx.core.data.caching.MemCacheHandlerError[source]#

Bases: Exception

Exception class for MemCacheHandler.

class otx.core.data.caching.MemCacheHandlerSingleton[source]#

Bases: object

A singleton class to create, delete and get MemCacheHandlerBase.

classmethod create(mode: str, mem_size: int) MemCacheHandlerBase[source]#

Create a new MemCacheHandlerBase instance.

Parameters:
  • mode (str) – There are two options: null, multiprocessing or singleprocessing.

  • mem_size (int) – The size of memory pool (bytes).

classmethod delete() None[source]#

Delete the existing MemCacheHandlerBase instance.

classmethod get() MemCacheHandlerBase[source]#

Get the created MemCacheHandlerBase.

If no one is created before, raise RuntimeError.

otx.core.data.caching.init_arrow_cache(dataset: Dataset, scheme: str | None = None, **kwargs) Dataset[source]#

Init arrow format cache from Datumaro.

Parameters:
  • dataset – Datumaro dataset

  • scheme – Datumaro apache arrow image encoding scheme.

  • kwargs – kwargs passed to ‘arrow_cache_helper’