Evaluation¶
-
evaluate_on_validationdata(config, model_name='', pipeline=None, model=None, save_grid=False, combine_halfs=False, save_single=False, save_prefix='', calc_stats=False)[source]¶ Evaluates supplied model on evaluation set of supplied data-pipeline and plots resulting distributions in regards to PSNR and SSIM.
- Parameters
config –
Initialized object of typeConfigUtil.Will be used for save path of resulting plots and to load model/pipeline in case they are not supplied.model_name – Name of model, will be used as label for plots.
pipeline –
Initialized object of typesimple_sr.DataPipeline.Will be initialized fromconfigif None.model – Object of type Keras.model, will be loaded from model path in config if None.
save_grid – Whether so save an image grid. (useful if image grid contains patches)
combine_halfs – Whether to save an image that’s upscaled with supplied models on one half and bicubic on the other half.
save_single – Whether to save single images.
save_prefix – Prefix for filenames.
calc_stats – Whether to calculate psnr and ssim.
-
evaluate_on_testdata(config, save_single=True, grid=False, interpolate=False, with_original=False, combine_halfs=False, pipeline=None, models=None, save_prefix='', segmentation_min_width=1000, segmentation_min_height=1000)[source]¶ Evaluates model(s) supplied via config on test data set of supplied data-pipeline. Images will be plotted for each supplied model according to supplied paramaters.
save_single,gridandcombine_halfscan be combined and images will be produced and stored for each option.interpolateandwith_originalare options to define the appearance ofgrid.- Parameters
config –
Initialized object of typeConfigUtilfromsimple_sr.utils.configmodule.Models will be loaded frommodel_pathsin config object.save_single – Whether to save upscaled images as single images.
grid – Whether so save an image grid. Supplied models will be plotted along rows, images across rows.
interpolate – Whether to add a row with interpolated images in grid for comparision.
with_original – Whether to plot original image next to image grid (useful if image grid contains patches)
combine_halfs – Whether to save an image that’s upscaled with supplied models on one half and bicubic on the other half.
pipeline –
Initialized object ofDataPipelinefromsimple_sr.data_pipelinepackage.Will be initialized from config if None.models – Dict of name: model where model is of type Keras.model. | If no dict is supplied, models will be load from path in config.model_path.
save_prefix – Prefix for filenames.
segmentation_min_width – Minimal width of images to be segmentated for memory efficient inference.
segmentation_min_height – Minimal height of images to be segmented for memory efficient inference.