import mxnet as mx
import mxnet.ndarray as nd
from skimage import io
import numpy as np
rec_path = path_prefix + ".rec"
idx_path = path_prefix + ".idx"
print(rec_path)
train_iter = mx.image.ImageIter(
batch_size=3,
data_shape=(3, 512, 512),
path_imgrec=rec_path,
path_imgidx=idx_path,
shuffle=True)
train_iter.reset()
for batch in train_iter:
x = batch.data[0]
y = batch.label[0]
break
print(y[0])
img = nd.transpose(x, (0, 2, 3, 1))
print(img.shape)
io.imshow(img[0].asnumpy().astype(np.uint8))
io.show()
Reason: After comparison discovery is caused by the MXNET version, reading the same REC file MXNET 1.6.0 does not report an error, while MXNET 1.7.0 error. You may need to regenerate the REC file agai...
The convolutional neural network is the cornerstone of breakthrough results in the field of computer vision in recent years. It is also widely used in other fields. There are also many related article...
The first step: running *mxnet\tools*Underim2rec.py File generation lst file The second step: convert the generated lst file into a rec file...
When using MXNET, the first step is to create an input format that meets the requirements of mxnet. When our task is: x is an image, and then y is the output of multiple (or single) labels, we can mak...
When the MXNet framework is used for image-related projects, there are two main ways to read images:The first is to read files in .rec formatSimilar to LMDB in the Caffe framework, the advantage is th...
Foreword Insightface-Data ZOOThe dataset of the face recognition algorithm is MXNET format, when we use Pytorch trainingDirect reading of human face data sets in REC formatIt can greatly speed up the ...
Just install the MXNET environment....
Complete source code: The effect is as follows:...