查看生成的数据维度
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
from __future__ import print_function
import numpy as np
def valid_imshow_data(data):
data = np.asarray(data)
if data.ndim == 2:
return True
elif data.ndim == 3:
if 3 <= data.shape[2] <= 4:
return True
else:
print('The "data" has 3 dimensions but the last dimension '
'must have a length of 3 (RGB) or 4 (RGBA), not "{}".'
''.format(data.shape[2]))
return False
else:
print('To visualize an image the data must be 2 dimensional or '
'3 dimensional, not "{}".'
''.format(data.ndim))
return False
data = np.load('/home/nkh/nkh/DSB2017-master/training/detector/results/res18/bbox/0a0c32c9e08cc2ea76a71649de56be6d_lbb.npy')
valid_imshow_data(data)/data.shape
clean.npy四维
label.npy二维
pbb.npy二维
lbb.npy一维