Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display an image in a Jupyter Notebook with Julia?

I have some image data like the following:

224×224×3×2 Array{Float32, 4}:
[:, :, 1, 1] =
 0.117647   0.117647   0.117647   0.117647   …  0.384314  0.396078  0.403922
 0.117647   0.117647   0.117647   0.117647      0.384314  0.392157  0.4
 0.117647   0.117647   0.117647   0.117647      0.384314  0.388235  0.392157
 0.121569   0.117647   0.121569   0.121569      0.388235  0.388235  0.388235
 0.12549    0.117647   0.12549    0.129412      0.396078  0.396078  0.396078

which I was using for some ML models. I want to be able to visualize the images in a notebook.

Right now I can do ImageView.imshow but that opens the image outside of the notebook. How can I display the image inside of the notebook?

like image 456
logankilpatrick Avatar asked Nov 08 '25 01:11

logankilpatrick


1 Answers

Just do:

IJulia.display(image)

For an example:

using Images
image = [RGB(rand(N0f8,3)...) for x in 1:200, y in 1:150]
using IJulia
IJulia.display(image)

enter image description here

like image 70
Przemyslaw Szufel Avatar answered Nov 12 '25 06:11

Przemyslaw Szufel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!