You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@karolzak
Thank you very much for your awesome repo. I am using you code for getting patches and reconstructing from patches, but it produces the following error:
When I use plot_patches:
Image Shape: (3648, 5472, 3) ### original image
Image_crop shape: (169, 512, 512, 3)
Traceback (most recent call last):
runfile('E:/PythonSampleCode/SliceMerge/slicemerge1.py', wdir='E:/PythonSampleCode/SliceMerge')
Reloaded modules: cv2, cv2.cv2, cv2.data
Image Shape: (3648, 5472, 3)
Image_crop shape: (169, 512, 512, 3)
Traceback (most recent call last):
File "<ipython-input-31-b244771ea495>", line 1, in <module>
runfile('E:/PythonSampleCode/SliceMerge/slicemerge1.py', wdir='E:/PythonSampleCode/SliceMerge')
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile
execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "E:/PythonSampleCode/SliceMerge/slicemerge1.py", line 195, in <module>
org_img_size=(x.shape[0], x.shape[1]), stride=256, size=256) # required - original size of the image
File "E:/PythonSampleCode/SliceMerge/slicemerge1.py", line 110, in plot_patches
axes[i, j].imshow(img_arr[jj])
IndexError: index 169 is out of bounds for axis 0 with size 169
when I use reconstruct_from_patches:
stride=256) # use only if stride is different from patch size
File "E:/PythonSampleCode/SliceMerge/slicemerge1.py", line 166, in reconstruct_from_patches
] = img_arr[kk, :, :, layer]
IndexError: index 169 is out of bounds for axis 0 with size 169
The crop size is 512 and stride is 256
Is there any suggestion?
The text was updated successfully, but these errors were encountered:
Hi @IbrahimLearning !
Thanks for submitting this feedback1
Just checked and indeed there's a problem with get_patches function. Because of how it is implemented right now it will only work for square images as input. It's an obvious mistake...
I'm marking this as a bug and will update this thread once it's fixed.
@karolzak
Thank you very much for your awesome repo. I am using you code for getting patches and reconstructing from patches, but it produces the following error:
When I use plot_patches:
Image Shape: (3648, 5472, 3) ### original image
Image_crop shape: (169, 512, 512, 3)
when I use reconstruct_from_patches:
The crop size is 512 and stride is 256
Is there any suggestion?
The text was updated successfully, but these errors were encountered: