mirapy.utils

Package Contents

mirapy.utils.get_psf_airy(n, nr)

Calculates Point Spread Function.

Parameters
  • n

  • nr

Returns

Numpy array of Point Spread Function

mirapy.utils.image_augmentation(images, image_data_generator, num_of_augumentations, disable=False)

Form augmented images for input array of images

Parameters
  • images – numpy array of Images.

  • image_data_generator – Keras image generator object.

  • num_of_augumentations – Number of augmentations of each image.

  • disable – Bool. Disable/enable tqdm progress bar.

Returns

Numpy array of augmented images.

mirapy.utils.psnr(img1, img2)

Calculate Peak Signal to Noise Ratio value.

Parameters
  • img1 – Float. Array of first image.

  • img2 – Float.Array of second image.

Returns

Float. PSNR value of x and y.

mirapy.utils.append_one_to_shape(x)

Reshapes input.

Parameters

x – Array input.

Returns

Reshaped array.

mirapy.utils.unpickle(file)

Unpickle and read file.

Parameters

file – Pickle file to read.

Returns

Data loaded from pickle file.

mirapy.utils.to_numeric(y)

Convert numpy array of array of probabilities to numeric array.

Parameters

y – Numpy array.

Returns

Numpy array of classes.

mirapy.utils.accuracy_per_class(y_true, y_pred)

Computes accuracy per class.

Parameters
  • y_true – True class.

  • y_pred – Predicted class.

Returns