python-3.x - Display image from url using holoviews
问题描述
How can I display an image from url. This result an error
import urllib
img = urllib.request.urlopen('https://www.edgystl.com/wp-content/uploads/2018/01/leather-bicker-jacket-model-street-style-men-1-e1530998880646.jpg')
hv.RGB(img)
解决方案
原来它可以用 skimage 完成
import holoviews as hv
from skimage import io
img = io.imread('https://www.edgystl.com/wp-content/uploads/2018/01/leather-bicker-jacket-model-street-style-men-1-e1530998880646.jpg')
hv.RGB(np.array(img))
推荐阅读
- microsoft-graph-api - Microsoft Graph - Outlook 邮件 api
- java - 当属性值包含关键字时,尝试使用 antlr2 解析 edifact 文件时出错
- python - 以广泛的数据格式循环 python auto_arima 通过几列
- r - 使用不等组观察值计算 LSD.test (agricolae) 的最小显着性差异
- javascript - 在 NavDropdown 中有 MenuItem 有一个链接
- bigdata - 我有 hadoop 1.0.3,当我使用 jps 命令时没有显示名称节点
- python - 如何在熊猫中堆叠和设置列名?
- android - 如何在 Roboelectric 中测试 activity.finishAffinity()?
- php - 将数组转换为关联数组和索引数组
- reactjs - 如何在不重新加载页面的情况下更新和删除