BBQuercus / deepBlink

Threshold independent detection and localization of diffraction-limited spots.
https://academic.oup.com/nar/advance-article/doi/10.1093/nar/gkab546/6312733
Other
32 stars 8 forks source link

Prediction of non-square images #117

Closed BBQuercus closed 3 years ago

BBQuercus commented 3 years ago

Describe the bug Prediction on horizontally biased images (long thin along the x-axis) don't predict properly using deepblink.inference.predict.

To Reproduce Steps to reproduce the behavior:

  1. Using the image below: image_hor
  2. Import both image and model and run pink.inference.predict(image, model) and it will only return 0.0 coordinates.

How to solve The image used has a padded shape of (64, 512). The current implementation of deepblink.inference.predict uses deepblink.data.get_coordinate_list(pred, image_pad.shape[0]). This [0] will lead to issues as the coordinate conversion will discard all coordinates beyond (64, 64). Using max(image_pad.shape) instead should do the trick.