简体   繁体   English

如何使用 Julia 在 Jupyter Notebook 中显示图像?

[英]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.我用于一些 ML 模型。 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.现在我可以做ImageView.imshow但这会在笔记本之外打开图像。 How can I display the image inside of the notebook?如何在笔记本内显示图像?

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)

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM