bob.med.tb.data.loader¶
Data loading code
Functions
|
Loads a sample data |
|
Loads a sample data |
|
Loads a sample data |
|
Returns a delayed-loading Sample object |
- bob.med.tb.data.loader.load_pil(path)[source]¶
Loads a sample data
- Parameters
path (str) – The full path leading to the image to be loaded
- Returns
image – A PIL image
- Return type
- bob.med.tb.data.loader.load_pil_baw(path)[source]¶
Loads a sample data
- Parameters
path (str) – The full path leading to the image to be loaded
- Returns
image – A PIL image in grayscale mode
- Return type
- bob.med.tb.data.loader.load_pil_rgb(path)[source]¶
Loads a sample data
- Parameters
path (str) – The full path leading to the image to be loaded
- Returns
image – A PIL image in RGB mode
- Return type
- bob.med.tb.data.loader.make_delayed(sample, loader, key=None)[source]¶
Returns a delayed-loading Sample object
- Parameters
sample (dict) – A dictionary that maps field names to sample data values (e.g. paths)
loader (object) – A function that inputs
sample
dictionaries and returns the loaded data.key (str) – A unique key identifier for this sample. If not provided, assumes
sample
is a dictionary with adata
entry and uses its path as key.
- Returns
sample – In which
key
is as provided anddata
can be accessed to trigger sample loading.- Return type