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
I am using the utils.py functions to work with RGB images. My mode works with RGB images and RGB masks and generates RGB masks (3 channel images). I am working with (256,256,3) images and masks. While running the code, I get the following error wit the plot_imgs function: How should we modify this plot function t work with RGB images? Thanks in advance.
Hi @sivaramakrishnan-rajaraman
Unfortunately these utils lack any tests or whatsoever and they were develop in a rush and designed only for single layer masks.
Don't have any quick fix for this atm but I encourage you to dig into the code and do a PR with necessary changes for everyones benefit.
I am using the utils.py functions to work with RGB images. My mode works with RGB images and RGB masks and generates RGB masks (3 channel images). I am working with (256,256,3) images and masks. While running the code, I get the following error wit the plot_imgs function: How should we modify this plot function t work with RGB images? Thanks in advance.
ValueError Traceback (most recent call last)
in
----> 1 plot_imgs(org_imgs=X_train, mask_imgs=y_train, pred_imgs=preds_train, nm_img_to_plot=1)
in plot_imgs(org_imgs, mask_imgs, pred_imgs, nm_img_to_plot, figsize, alpha, color)
145 mask_to_rgba(
146 zero_pad_mask(pred_imgs[im_id], desired_size=org_imgs_size),
--> 147 color=color,
148 ),
149 cmap=get_cmap(pred_imgs),
in mask_to_rgba(mask, color)
59 w = mask.shape[1]
60 zeros = np.zeros((h, w))
---> 61 ones = mask.reshape(h, w)
62 if color == "red":
63 return np.stack((ones, zeros, zeros, ones), axis=-1)
ValueError: cannot reshape array of size 196608 into shape (256,256)
The text was updated successfully, but these errors were encountered: