mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Question about random crop in ImageRecordIter

Open MDR-EX1000 opened this issue 9 years ago • 0 comments

I always get the same result at two random crops of the same Image when using ImageRecorder. I've found a similar issue(closed) but I can't figure out how to get the correct result.

Some of my codes:

train_iter = mx.io.ImageRecordIter(
	path_imgrec='/path/to/svhn_train.rec',
	data_shape=(3,15,15),
	batch_size= 2,
	random_crop=True
	)

train_iter.reset()
data = train_iter.next().data[0].asnumpy().astype(np.uint8)
for i in range(2):
	X = data[i]
	X = X.transpose((1,2,0))
	plt.imshow(X)
	plt.show()

train_iter.reset()
data = train_iter.next().data[0].asnumpy().astype(np.uint8)
for i in range(2):
	X = data[i]
	X = X.transpose((1,2,0))
	plt.imshow(X)
	plt.show()

MDR-EX1000 avatar Jun 15 '17 14:06 MDR-EX1000