我们是否可以将图像从图像 URL 直接加载到 Keras/TensorFlow 中的 CNN 模型,而不将图像存储在本地目录中?

Deb*_*tra 5 computer-vision deep-learning conv-neural-network

我想从图像 URL 检索图像并将其输入 keras 中的 CNN 模型,但我不想将图像存储在本地文件夹中?

有没有办法做到这一点 ?

nat*_*ncy 0

您可以使用skimage这样的方式从图像 URL 读取图像

from skimage import io
import cv2

# Read image from web image
image = io.imread('https://i.stack.imgur.com/QupKb.png')

# Display image
cv2.imshow('image', image)
cv2.waitKey()
Run Code Online (Sandbox Code Playgroud)