vis4d.data.io.base¶
Backends for the data types a dataset of interest is saved in.
Those can be used to load data from diverse storage backends, e.g. from HDF5 files which are more suitable for data centers. The naive backend is the FileBackend, which loads from / saves to file naively.
Classes
Abstract class of storage backends. |
- class DataBackend[source]¶
Abstract class of storage backends.
All backends need to implement three functions: get(), set() and exists(). get() reads the file as a byte stream and set() writes a byte stream to a file. exists() checks if a certain filepath exists.
- abstract exists(filepath)[source]¶
Check if filepath exists.
- Parameters:
filepath (str) – The filepath to check.
- Returns:
True if the filepath exists, False otherwise.
- Return type:
bool
- abstract get(filepath)[source]¶
Get the file content at the given filepath as bytes.
- Parameters:
filepath (str) – The filepath to retrieve the data from.”
- Returns:
The content of the file as bytes.
- Return type:
bytes
- abstract isfile(filepath)[source]¶
Check if filepath is a file.
- Parameters:
filepath (str) – The filepath to check.
- Returns:
True if the filepath is a file, False otherwise.
- Return type:
bool