Skip to content

Commit 2b063e9

Browse files
committed
Allow votes_to_detections to return the grids.
1 parent af85890 commit 2b063e9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def precision_recall_curve(precrecs, ls='-o', ax=None, **figkw):
165165
return ret
166166

167167

168-
def votes_to_detections(locations, probas=None, in_rphi=True, out_rphi=True, bin_size=0.1, blur_win=11, blur_sigma=5.0, x_min=-15.0, x_max=15.0, y_min=-5.0, y_max=15.0):
168+
def votes_to_detections(locations, probas=None, in_rphi=True, out_rphi=True, bin_size=0.1, blur_win=21, blur_sigma=2.0, x_min=-15.0, x_max=15.0, y_min=-5.0, y_max=15.0, retgrid=False):
169169
'''
170170
Convert a list of votes to a list of detections based on Non-Max supression.
171171
@@ -226,7 +226,8 @@ def votes_to_detections(locations, probas=None, in_rphi=True, out_rphi=True, bin
226226
# Back from grid-bins to real-world locations.
227227
m_x = m_x*bin_size + x_min + bin_size/2
228228
m_y = m_y*bin_size + y_min + bin_size/2
229-
return [(xy_to_rphi(x,y) if out_rphi else (x,y)) + (np.argmax(p),) for x,y,p in zip(m_x, m_y, m_p)]
229+
maxima = [(xy_to_rphi(x,y) if out_rphi else (x,y)) + (np.argmax(p),) for x,y,p in zip(m_x, m_y, m_p)]
230+
return (maxima, grid) if retgrid else maxima
230231

231232

232233
def generate_cut_outs(scan, standard_depth=4.0, window_size=48, threshold_distance=1.0, npts=None, border=29.99, resample_type='cv', **kw):

0 commit comments

Comments
 (0)