IQM_Vis.utils package
Submodules
IQM_Vis.utils.gui_utils module
Utils for PyQt6 image, text and graph widgets
- class IQM_Vis.utils.gui_utils.MplCanvas(size=(3.5, 3.5), dpi=100, polar=False)[source]
Bases:
matplotlib.backends.backend_qtagg.FigureCanvasQTAgg
IQM_Vis.utils.image_utils module
image helper functions
- IQM_Vis.utils.image_utils.calibrate_brightness(im, rgb_brightness, display_brightness, ubyte=True)[source]
- IQM_Vis.utils.image_utils.crop_centre(image, scale_factor=2, keep_size=True)[source]
- crop to the centre of the image, note this will return a small image size
so it best used as post processing
- Parameters
image (np.array) – image to be cropped
scale_factor (float) – the percentage to zoom in by (for square crop only). 0.5 = 2x zoom out 1 = normal size 2 = 2x zoom in (Defaults to 2 - half the size)
keep_size (bool) – resize image to the original size after cropping (Defaults to True)
- Returns
cropeed image
- Return type
image (np.array)
- IQM_Vis.utils.image_utils.get_transform_image(data_store, transform_functions, transform_params)[source]
transform image with image post processing
- Parameters
data_store – IQM_Vis data_api
transform_functions – dict holding transforms (each key is the name of transform, items have key ‘function’)
transform_params – dict holding the parameters for transforms (corresponding to keys in transform_functions)
- Returns
processed numpy image
- Return type
image
- IQM_Vis.utils.image_utils.resize_image(img, size=128)[source]
resize image to square or specified size
IQM_Vis.utils.plot_utils module
matplotlib plotting helpers TODO: write dev_resources/docs how to use these (currently just have to look at the UI code)
- IQM_Vis.utils.plot_utils.click_scatter(_plot, change_trans_value_signal, event)[source]
send signal of which data point was clicked
- IQM_Vis.utils.plot_utils.compute_metric_for_human_correlation(data_store, transforms, metric_params, trans_str_values, metric)[source]
- IQM_Vis.utils.plot_utils.compute_metrics_over_range(data_store, transforms, transform_values, metric_params, metrics_to_use, pbar_signal=None, stop_flag=None, num_steps=11)[source]
compute metrics over a range of trans (when using non initial values for other transforms) currently this method is not being used and instead using the simpler compute_metrics_over_range_single_trans
- Parameters
data_store – object containing metrics and image
transforms (dict) – containing trans functions and min/max/initial values
transform_values (dict) – containing the fixed current transform parameter values
- Returns
- results of IQM values at each transform value across its
whole paramter rance for the reference image
- Return type
results (dict)
- IQM_Vis.utils.plot_utils.compute_metrics_over_range_single_trans(data_store, transforms, metric_params, metrics_to_use, pbar_signal=None, stop_flag=None, num_steps=11)[source]
compute metrics over a range of trans
- Parameters
data_store – object containing metrics and image
transforms (dict) – containing trans functions and min/max/initial values
- Returns
- results of IQM values at each transform value across its
whole paramter rance for the reference image
- Return type
results (dict)
- IQM_Vis.utils.plot_utils.get_all_single_transform_params(transforms, num_steps=11)[source]
get a list of all the individual transforms with a single parameter value useful when doing experiments to make a dataset
- IQM_Vis.utils.plot_utils.get_correlation_plot(human_scores, metric_scores, axes, metric, change_trans_value_signal)[source]
scatter plot for correlations
- IQM_Vis.utils.plot_utils.get_radar_plots_avg_plots(results, metrics_names, transformation_names, axes, lim=1)[source]
plot results on a polar axes -> radar/spider plot
- IQM_Vis.utils.plot_utils.get_transform_range_plots(results, transform, axes, lim=1)[source]
plot a single transform range graph of all metrics
- class IQM_Vis.utils.plot_utils.line_plotter(ax, x_label='', y_label='', lim=1)[source]
Bases:
object
- class IQM_Vis.utils.plot_utils.radar_plotter(radar_names, var_names, ax, lim=1)[source]
Bases:
object
IQM_Vis.utils.save_utils module
utils for saving experiments, images and figures
- IQM_Vis.utils.save_utils.DEFAULT_SAVE_DIR = '/home/matt/IQM-Vis'
getters for experiment files from save dir
- IQM_Vis.utils.save_utils.get_JND_image_names(dir)[source]
load the image names from a JND experiment
- IQM_Vis.utils.save_utils.save_2AFC_experiment_results(trans_names, results_order, save_dir, times_taken=None, IQM_scores_df=None)[source]
save all the experiment reults as csvs
- IQM_Vis.utils.save_utils.save_JND_experiment_results(experiment_results, save_dir, IQM_scores_df=None)[source]