Mxnet loads the rec file and displays the image detection

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()

Intelligent Recommendation

MXNET RECORDIO reads the REC file POS = ctypes.c_size_t (self.idx [idx]) error KEYERROR: 0

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...

MXNET convolutional neural network's detection of image edges

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...

Mxnet generates lst and rec files (version 1.1.0)

The first step: running *mxnet\tools*Underim2rec.py File generation lst file The second step: convert the generated lst file into a rec file...

Make multi-label .rec as MXNET input

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...

How MXNet generates .lst files and .rec files

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...

More Recommendation

Pytorch reads the REC format data for MXNET

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 ...

MXNet command line make REC data set

Just install the MXNET environment....

pytorch 1.7.0 reads the mnist data set, loads and displays the image

Complete source code: The effect is as follows:...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top