Open jiagh2010 opened 5 years ago
@jiagh2010 Which task do you want to run? Maybe you can reference the example of mobileface_allinone.py
I'm try to run it on raspberry pi 4b, The way to install mxnet is pip install from official whl (mxnet-1.5.0-py2.py3-none-any.whl), maybe it's not use opencv when it's compile.
So I get this error when run "python get_face_boxes_gluoncv.py":
mxnet.base.MXNetError: [10:31:27] /work/mxnet/src/io/image_io.cc:249: Build with USE_OPENCV=1 for image io.
Therefore, I'm try to use cv2.imread instead of presets.yolo.load_test, but failed, I'm new to mxnet, I don't know how to pass paramters to it.
mobileface_allinone.py is also use presets.yolo.load_test to parse image.
@smilence86 You can use this code to transform the image format from opencv Mat to mxnet NDArray.
@becauseofAI I'm also get same error by these codes:
#python3 get_face_boxes_gluoncv.py
#x, img = presets.yolo.load_test(image, short=img_short)
frame = cv2.imread(image)
img_nd = nd.array(frame)
x, img = data_trans(img_nd, short=img_short)
x = x.as_in_context(ctx[0])
result = net(x)
Traceback (most recent call last):
File "get_face_boxes_gluoncv.py", line 55, in
@smilence86 Have you build the MXNet with USE_OPENCV=1? Maybe you can use anaconda3 to install mxnet and opencv-python to test the code firstly.
how to use cv2 ?read image as the input of function