python-3.x - 嗨,我想遍历 numpy 数组以仅显示 2656 个图像中的 100 个图像
问题描述
这是我的数组形状打印 (img_array.shape) (2656, 256, 256, 3)
这就是我打印单个图像的方式
from matplotlib import pyplot as plt
from google.colab.patches import cv2_imshow
img3 = img_array[2655,:,:,:]
cv2_imshow(img3)
我想提前打印 100 份谢谢
解决方案
对于前 100 张图像
img3 = img_array[0:99]
但它产生错误 TypeError: Cannot handle this data type: (1, 1, 256, 3), |u1
推荐阅读
- debugging - Visual Studio 2017 中的“启用 GPU 反汇编集合”在哪里?
- java - 什么可以在不更改代码的情况下破坏 android 构建?
- java - 在 Java 中使用“oracle.xdb.XMLType”
- sql - 在 sql server 中发生不可提交事务的情况下如何获取实际错误?
- python - 我已经安装了 tensorflow(CPU) 并为它创建了环境。我在 anacondaa 版本上运行代码,但运行代码时 spyder shwing 错误
- c# - 如何从 ASP.NET 核心执行 [HttpGet] 获取任意参数
- jsoup - JSoup Element WholeText 去除间距
- java - 为什么我的应用程序没有在 .close() 上发布文件以便可以删除它们?
- android - annonymus 类如何将自己从点击事件中移除
- jenkins - 通过 Jenkins 作业从脚本调用类的方法时无法解析类