DefaultPredictor

public class DefaultPredictor extends AbstractPredictor implements Predictor

Makes density map predictions from images.

Author:Baptiste Ottino, Kyle M. Douglass

Methods

finalize

protected void finalize()

Failsafe in case the TensorFlow session has not been closed.

Throws:

getCount

public double getCount()

Returns the most recent count.

Throws:
Returns:

The predicted count from the density map.

getDensityMap

public FloatProcessor getDensityMap()

Returns the most recently calculated density map prediction.

Throws:
Returns:

The predicted density map.

getLocalCountMap

public FloatProcessor getLocalCountMap()

Returns the most recently-calculated local count map.

Throws:
Returns:

The most recently calculated local count map.

getMaximumLocalCount

public double getMaximumLocalCount(int boxSize)

Returns the maximum local count value. This value is obtained by convolving the density map with a square kernel whose values are all 1 and then taking the maximum of the resulting map. It effectively produces the highest count value over length scales equal to the size of the kernel.

Parameters:
  • boxSize – The width of the square kernel.
Throws:
Returns:

The maximum local count from the density map.

predict

public void predict(ImageProcessor ip)

Makes a density map prediction from a 2D image. If either of the image’s width or height is not divisible by 4, they will be cropped to the next largest multiple of four.

Parameters:
  • ip – The image to perform a prediction on.
Throws: