IQM_Vis.data_handlers package

Submodules

IQM_Vis.data_handlers.data_api module

generic image and metric data class constructor both use the same image for reference and transformed

class IQM_Vis.data_handlers.data_api.cache_metric_call(metric)[source]

Bases: object

cache metric fucntions that have been calculated already to do this we need to convert numpy arrays to a hashable object (since arrs are mutable) to achieve this we convert to a bytes array (input to __call__) then load this from buffer

__call__(ref, trans, **kwargs)[source]

Call self as a function.

IQM_Vis.data_handlers.data_api.cache_tracked(func)[source]
class IQM_Vis.data_handlers.data_api.dataset_holder(image_list: list, metrics: dict = {}, metric_images: dict = {}, image_loader=<function load_image>, image_pre_processing=None, image_post_processing=None, image_list_to_transform=None, human_exp_csv=None)[source]

Bases: IQM_Vis.data_handlers.data_api_abstract.base_dataset_loader

Stores images and metrics to communicate with the UI via the IQM-Vis data API.

Parameters
  • image_list (list) – list of image file paths

  • metrics (dict) – dictionary with keys of the metric names and values of the callable metric function

  • metric_images (dict) – Optional dictionary with keys of the metric image names and values of the callable metric image function (Defaults to {})

  • image_loader (function) – Optional function which loads an image from a file path (Defaults to IQM_Vis.utils.load_image)

  • image_post_processing (function) – Optional function to apply after image transformations. For example cropping an image after rotation. (Defaults to None)

  • image_list_to_transform (list) – list of image file paths for images to transform if they are different to the reference images. If None then will use the same image as the reference image. (Defaults to None)

add_metric(key, value)[source]
add_metric_image(key, value)[source]
clear_all_cache()[source]
get_image_dataset_list()[source]
get_image_to_transform()[source]
get_image_to_transform_name()[source]
get_metric_images(transformed_image, metrics_to_use='all', **kwargs)[source]
get_metrics(transformed_image, metrics_to_use='all', **kwargs)[source]
get_reference_image()[source]
get_reference_image_by_index(index)[source]
get_reference_image_name()[source]
get_reference_unprocessed()[source]
load_image_list(image_list)[source]
IQM_Vis.data_handlers.data_api.get_image_name(file_path)[source]

IQM_Vis.data_handlers.data_api_abstract module

blueprint for data loader API

class IQM_Vis.data_handlers.data_api_abstract.base_dataloader[source]

Bases: abc.ABC

abstract get_image_to_transform()[source]
abstract get_image_to_transform_name()[source]
abstract get_metric_images()[source]
abstract get_metrics()[source]
abstract get_reference_image()[source]
abstract get_reference_image_name()[source]
property metric_images
property metrics
class IQM_Vis.data_handlers.data_api_abstract.base_dataset_loader[source]

Bases: IQM_Vis.data_handlers.data_api_abstract.base_dataloader

abstract get_reference_image_by_index(index)[source]

Module contents