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

win_size exceeds image extent. Either ensure that your images are at least 7x7; #90

Open
Shichao123123 opened this issue Jul 31, 2023 · 0 comments

Comments

@Shichao123123
Copy link

when I run the renderer.py ,How should this problem be solved
--------------------------ValueError Traceback (most recent call last)
Input In [10], in <cell line: 2>()
108 rgb_rays = rgb_rays[H_crop:-H_crop,W_crop:-W_crop]
110 psnr.append( mse2psnr(np.mean((rgb_rays-img)**2)))
--> 111 ssim.append( structural_similarity(rgb_rays, img, multichannel=True))
113 img_tensor = torch.from_numpy(rgb_rays)[None].permute(0,3,1,2).float()*2-1.0 # image should be RGB, IMPORTANT: normalized to [-1,1]
114 img_gt_tensor = torch.from_numpy(img)[None].permute(0,3,1,2).float()*2-1.0

File ~/miniconda3/lib/python3.8/site-packages/skimage/metrics/_structural_similarity.py:178, in structural_similarity(im1, im2, win_size, gradient, data_range, channel_axis, gaussian_weights, full, **kwargs)
175 win_size = 7 # backwards compatibility
177 if np.any((np.asarray(im1.shape) - win_size) < 0):
--> 178 raise ValueError(
179 'win_size exceeds image extent. '
180 'Either ensure that your images are '
181 'at least 7x7; or pass win_size explicitly '
182 'in the function call, with an odd value '
183 'less than or equal to the smaller side of your '
184 'images. If your images are multichannel '
185 '(with color channels), set channel_axis to '
186 'the axis number corresponding to the channels.')
188 if not (win_size % 2 == 1):
189 raise ValueError('Window size must be odd.')

ValueError: win_size exceeds image extent. Either ensure that your images are at least 7x7; or pass win_size explicitly in the function call, with an odd value less than or equal to the smaller side of your images. If your images are multichannel (with color channels), set channel_axis to the axis number corresponding to the channels.------------------------------------------------------

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

1 participant