dtype'uint8'的3D np.array作为元素的dtype'object'的4D np.array

时间:2019-06-29 17:33:58

标签: python numpy

type(imgs):                                                                                                           |
<class 'numpy.ndarray'>
--------
imgs.shape                                                                                                           |
(40,) 
-------
imgs[0].shape                                                                                                        |
(3, 512, 512)   
-------
imgs
  255, 255, 255, 255, 255, 255, 255, 255]]], dtype=uint8)],                                                         |
      dtype=object) 
-------
imgs[0].dtype                                                                                                        |
dtype('uint8')   
-------
imgs.dtype                                                                                                           |
dtype('O')   
-------
imgs[39].dtype                                                                                                       |
dtype('uint8')  

我想将imgs格式化为dtype('uint8')的4D np.array,而不是dtype('Object')的1D np.array,其中每个元素都是dtype('uint8')的3D np.array )。

0 个答案:

没有答案