如何显示来自url的图像。 结果是错误
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)
答案 0 :(得分:0)
HoloViews RGB元素通常期望使用NumPy数组,从Image获取数组的最简单方法是使用PIL(或Pillow)库并根据请求下载它。看起来像这样:
import java.text.DecimalFormat;
...
Double value = Double.parseDouble("0.00000012");
DecimalFormat formatter = new DecimalFormat("0.#####E0");
String formatted = formatter.format(value);
System.out.println(formatted);
答案 1 :(得分:0)
结果证明可以使用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(img)