Train mxnet unet and run it on ncnn.
Dataset from https://github.com/TianzhongSong/Person-Segmentation-Keras
Some code from: https://github.com/milesial/Pytorch-UNet/tree/master/unet
Blog link: https://blog.csdn.net/xiexiecn/article/details/83029787
How to use:
-
Get dataset and put it in the some directory. Adjust files under mxnet-unet/data based on dataset location.
-
cd mxnet-unet; python3 trainunet.py
-
Get inference model by running: python3 train2infer.py
-
Use ncnn tool 'mxnet-ncnn' to get ncnn model
Need to patch tools/mxnet/mxnet2ncnn.cpp for ncnn. Set num_group to 1 in if for "Deconvolution" op. But I think it will fix also if designate it in mxnet network.
-
Run ncnn-unet.
Install OpenCV first.
cd ncnn-unet
Edit CMakefiles to fit your enviroment.
mkdir build
cmake ..; make
./unet your_jpg_file