Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when there is less than 4 point gaussian_filter_density get an error #7

Open
s-JoL opened this issue Jun 20, 2019 · 3 comments
Open

Comments

@s-JoL
Copy link

s-JoL commented Jun 20, 2019

No description provided.

@s-JoL
Copy link
Author

s-JoL commented Jun 20, 2019

~/workspace/xxx/yyy/utils/k_nearest_gaussian_kernel.py in gaussian_filter_density(img, points)
     45         print(pt2d, sigma, gt_count, distances)
     46         density += scipy.ndimage.filters.gaussian_filter(
---> 47             pt2d, sigma, mode='constant')
     48     print('done.')
     49     return density

~/miniconda3/envs/pytorch1.0/lib/python3.7/site-packages/scipy/ndimage/filters.py in gaussian_filter(input, sigma, order, output, mode, cval, truncate)
    287         for axis, sigma, order, mode in axes:
    288             gaussian_filter1d(input, sigma, axis, order, output,
--> 289                               mode, cval, truncate)
    290             input = output
    291     else:

~/miniconda3/envs/pytorch1.0/lib/python3.7/site-packages/scipy/ndimage/filters.py in gaussian_filter1d(input, sigma, axis, order, output, mode, cval, truncate)
    202     sd = float(sigma)
    203     # make the radius of the filter equal to truncate standard deviations
--> 204     lw = int(truncate * sd + 0.5)
    205     # Since we are calling correlate, not convolve, revert the kernel
    206     weights = _gaussian_kernel1d(sigma, order, lw)[::-1]

OverflowError: cannot convert float infinity to integer

@lucyandjason
Copy link

I also have this problem ,can you solve it?

@Preston-Dong
Copy link

Excuse me, I also met this problem, how did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants