Showing posts with label images. Show all posts
Showing posts with label images. Show all posts

Wednesday, October 2, 2019

Image bytes to np array in Python

For reference:

# data - image bytes

im = Image.open(BytesIO(data))
I =  numpy.asarray(im)
print("I type:", type(I), "I shape:", I.shape)

>> I type: <class 'numpy.ndarray'> I shape: (512, 512, 3)

Upgrade nodejs in conda (from v18 to v26)

If your conda env is nodejs v18, doing a conda install nodejs=26 is likely to create a lot of conflict. Consider remove those conflicting p...