1.安装相关环境
pytorch安装
https://blog.youkuaiyun.com/loco1223/article/details/91354337
其他小环境
pip install ipdb
pip install opencv-python
pip install scipy
pip install scikit-image
pip install matplotlib
pip install cupy-cuda80//我的cuda版本是8.0
以及torchnet
https://blog.youkuaiyun.com/weixin_43264516/article/details/83187775
下载torchnet:
https://github.com/pytorch/tnt
用Anaconda Prompt激活环境后cd到所在文件目录下
安装torchnet:
python setup.py build
python setup.py install
2.初步检测
在github上下载相关模型
两个都是需要的,VGG模型应该是用于前部分衔接。
将两个模型直接放置于解压后的工程下
修改部分代码
src目录下的config.py文件内caffe_pretrain_path路径
一开始这些路径都是为ubuntu设计的。
在终端输入代码
python head_detection_demo.py --img_path 1.png --model_path head_detector_final
会报错,但会有结果,暂时不知道怎么修改。
3.改正框位置不正确
参考
https://blog.youkuaiyun.com/missyougoon/article/details/90408970
4.some
1、a bytes-like object is required,not ‘str’:
https://blog.youkuaiyun.com/csu_vc/article/details/78372932/
2、安装SQLite3:
https://blog.youkuaiyun.com/say_hi_andhelloworld/article/details/86062102
3、TypeError: le() received an invalid combination of arguments - got (numpy.ndarray), but expected one of:
- (Tensor other)
didn’t match because some of the arguments have invalid types: (numpy.ndarray) - (Number other)
didn’t match because some of the arguments have invalid types: (numpy.ndarray)
https://github.com/aditya-vora/FCHD-Fully-Convolutional-Head-Detector/issues/28
add this code ‘min_size=np.array(min_size)’ before ‘keep = np.where((hs >= min_size) & (ws >= min_size))[0]’
4、 the python code for non_maximum_suppression is about 2x slow
It is strongly recommended to build cython code:
cd model/utils/nms/; python3 build.py build_ext --inplace
cd model/utils/nms/; python3 build.py build_ext --inplace’’’)
https://github.com/aditya-vora/FCHD-Fully-Convolutional-Head-Detector/issues/27
5、pytorch报错Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X
https://blog.youkuaiyun.com/legalhighhigh/article/details/82819747
注:
目前基本放弃在win10上测试了,需要的python2.7环境等无法win10上很好的创建,比如CUDA9.0 没有支持python2.7的版本,以及遇到的无法联网记录等问题,决定接下来在ubuntu上进行测试,注定是个很漫长的过程。
待续吧。。。