mvsnerf icon indicating copy to clipboard operation
mvsnerf copied to clipboard

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

Open Shichao123123 opened this issue 11 months ago • 0 comments

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.------------------------------------------------------

Shichao123123 avatar Jul 31 '23 11:07 Shichao123123