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

viz3 = np.vstack((255*tgt_img_viz, 255*depth_viz, 255*mask_viz... in test_mask #17

Open
gagajian opened this issue Oct 27, 2019 · 3 comments

Comments

@gagajian
Copy link

Hello, there seems something wrong with "vstack". The codes reports error as follows:

viz3_im = Image.fromarray(viz3.astype('uint8'))
TypeError: Cannot handle this data type

Can you help me with this, thanks!

@JohnnieXDU
Copy link

you should change 'viz3.astype('uint8')' to 'viz3.transpose(1, 2, 0).astype('uint8')', due to the format should be [h, w, 3], not [3, h, w].

@lotus0903
Copy link

you should change 'viz3.astype('uint8')' to 'viz3.transpose(1, 2, 0).astype('uint8')', due to the format should be [h, w, 3], not [3, h, w].

Through this, I also got the issue about typeerror and the black flow images. Do you know the reason? Thanks a lot.

@anuragranj
Copy link
Owner

You need to make sure of the following. Maybe the conventions have changed with pytorch versions.

  1. If you are using the correct dim order HWC or CHW.
  2. If you in the correct range, there is a multiplication by 255 which assumes that the expected range should be 0-255. However if conventions have changed to 0-1 then avoid this multiplication.

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

4 participants