deepblink.inference module¶
Model prediction / inference functions.
-
deepblink.inference.
get_intensities
(image: numpy.ndarray, coordinate_list: numpy.ndarray, radius: int, method: str = 'sum') → numpy.ndarray[source]¶ Finds integrated intensities in a radius around each coordinate.
Parameters: - image – Input image with pixel values.
- coordinate_list – List of r, c coordinates in shape (n, 2).
- radius – Radius of kernel to determine intensities.
- method – How the integrated intensity should be calculated [options: sum, mean, std].
Returns: Array with all integrated intensities.
-
deepblink.inference.
get_probabilities
(matrix: numpy.ndarray, coordinates: numpy.ndarray, image_size: int = 512) → numpy.ndarray[source]¶ Find prediction probability given the matrix and coordinates.
Parameters: - matrix – Matrix representation of spot coordinates.
- coordinates – Coordinates at which the probability should be determined.
- image_size – Default image size the grid was layed on.
Returns: Array with all probabilities matching the coordinates.
-
deepblink.inference.
predict
(image: numpy.ndarray, model: keras.engine.training.Model, probability: Union[None, float] = None) → numpy.ndarray[source]¶ Returns a binary or categorical model based prediction of an image.
Parameters: - image – Image to be predicted.
- model – Model used to predict the image.
- probability – Cutoff value to round model prediction probability.
Returns: List of coordinates [r, c].