def gen_data():
ix = np.arange(K)
images = np.random.randint(0, 255, size=K//2*S*S).reshape(-1, S, S).astype('uint8')
top = np.random.randint(0, 3, size=K*2).reshape(-1, 2).astype('uint8')
size = np.random.randint(3, 7, size=K*2).reshape(-1, 2).astype('uint8')
pos = np.random.choice(range(len(images)), replace=True, size=K)
data = images, top, size, pos
#dsindex = DatasetIndex(ix)
ds = Dataset(index=ix, batch_class=MyBatch)
return ds, data
# Create datasets
评论列表
文章目录