fullfanta / CNN_based_Face_Alignment

Face Alignment using Convolutional Neural Networks
20 stars 11 forks source link

the problem of im2rec #2

Closed zhuhongweiyi closed 7 years ago

zhuhongweiyi commented 7 years ago

Could you tell how to run im2rec on windows? I edit im2rec.sh as im2rec.bat, as follows: @echo off echo "Generating rec" python D:/mxnet/mxnet/tools/im2rec.py ./training_data ../crop_images --pack-label=True python D:/mxnet/mxnet/tools/im2rec.py ./test_data ../crop_images --pack-label=True but couldn't succeed(im2rec.py didn't contain parameter label_width) I hope you can reply me, thanks

fullfanta commented 7 years ago

@zhuhongweiyi

I used https://github.com/dmlc/mxnet/blob/master/tools/im2rec.cc to record images and multi labels. I didn't try mxnet on windows but I think you can compile im2rec.cc in windows and execute it.

fullfanta commented 7 years ago

@zhuhongweiyi

In https://github.com/dmlc/mxnet/blob/master/tools/im2rec.py#L79-L87, you can see that each line on list file is split by '\t' automatically.

I think you don't need to give parameter 'label_width' in im2rec.py.

zhuhongweiyi commented 7 years ago

@fullfanta thanks,I try the method as follows: @echo off echo "Generating rec" python D:/mxnet/mxnet/tools/im2rec.py training_data ./ --pack-label=True python D:/mxnet/mxnet/tools/im2rec.py test_data ./ --pack-label=True pause but it also could't succeed the problem is: image Should I regenerate the lst?

fullfanta commented 7 years ago

@zhuhongweiyi

I found my mistake when I generate lst file. I used space to split item as https://github.com/fullfanta/CNN_based_Face_Alignment/blob/master/prepare_data/collect_augmented_images.py#L137-L139

But, in im2rec.py, they split item by '\t' as https://github.com/dmlc/mxnet/blob/master/tools/im2rec.py#L85

So, If you edit collect_augmented_images.py and regenerate lst file, you can use im2rec.py as python im2rec.py --num-thread 32 --pack-label true training_data ./

I'll check collect_augmented_images.py and commit it if it has no problem.

zhuhongweiyi commented 7 years ago

@fullfanta Thank you very much!