我在pandas DataFrame中有一列图像路径。它由99.8万行组成。
例如:
data['ImagesPaths'] = {'path1', 'path2', etc...}
我想将cv2.read()
应用于此列以具有“图像阵列”列
您如何建议这样做以获得快速效果?
答案 0 :(得分:0)
看起来您只想遍历data ['ImagesPaths']列,可以很容易地完成该操作:
for image_path in data['ImagesPaths']:
image = cv2.read(image_path)
# do smth.
我认为image_path检索的速度在这里不是问题,大部分时间将花费在图像读取和处理上。