VS2015 https://blog.****.net/guxiaonuan/article/details/73775519?locationNum=2&fps=1
OPENCV https://blog.****.net/greenhandcgl/article/details/80505701
CUDA https://blog.****.net/u013165921/article/details/77891913
CUDA其中有些地方需要修改:
CUDA_SDK_PATH C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2
CUDA_BIN_PATH %CUDA_PATH%\bin
CUDA_LIB_PATH %CUDA_PATH%\lib\x64
CUDA_SDK_BIN_PATH %CUDA_SDK_PATH%\bin
CUDA_SDK_LIB_PATH %CUDA_SDK_PATH%\lib\x64
判断是Debug编译, 还是Release编译。
判断是32位, 还是64位。
- #include "json/json.h"
- #ifdef _DEBUG
- #ifndef _WIN64
- #pragma comment(lib,"json/json_mtd.lib")
- #else
- #pragma comment(lib,"json/json_mtd_x64.lib")
- #endif
- #else
- #ifndef _WIN64
- #pragma comment(lib,"json/json_mt.lib")
- #else
- #pragma comment(lib,"json/json_mt_x64.lib")
- #endif
- #endif
- using namespace Json;
DEBUG 与 RELEASE的区别:
Debug选项称为调试版本,顾名思义这个选项是调试的时候使用的。这个选项的配置中,所有代码生成的优化都是关闭的,于是我们触发断点后可以通过即时/局部变量窗口来观察对应的变量。
Release选项称为发布版本,这个选项的配置使得编译器可以对我们的代码进行低等级的,复杂的优化。优化后代码可能会”面目全非“,导致单步调试变得不可行,我们也无法在变量窗口中看到变量,因为我们要观察的变量可能被优化了。并且发布版本不会生成.PDB文件(.PDB文件让调试器能知汇编指令与代码行数之间的对应关系)
编译流程: https://blog.****.net/shadandeajian/article/details/80913481
更完整的流程: https://blog.****.net/sinat_35907936/article/details/82017127
预训练权重下载: https://pjreddie.com/darknet/yolo/
编译好后, 进入exe目录, darknet.exe detector test data/coco.data yolov3.cfg yolov3.weights -i 0 -thresh 0.25 dog.jpg
修改并打开工程文件: darknet.vcxproj
VC++ 目录:
包含目录: D:\library\opencv\build\include;D:\library\opencv\build\include\opencv;D:\library\opencv\build\include\opencv2;$(CUDA_PATH)\include;$(IncludePath)
库目录: D:\library\opencv\build\x64\vc14\lib;$(CUDA_PATH)\lib\x64;$(LibraryPath)
链接器:
附加库目录: D:\library\opencv\build\x64\vc14\lib;%(AdditionalLibraryDirectories)
输入: 附加依赖项: opencv_world340d.lib cublas.lib cuda.lib cudadevrt.lib
--------------------------------------------训练模型-------------------------------------------------
# 构建自定义的数据集:
darknet.exe detector train mydata/my.data mydata/yolov3.cfg yolov3.weights
1. 使用voc_label.py 生成 VOCdevkit//VOC2007//labels// 与 2007_train.txt 等文件。
2. 将图片jpg与标签txt放置在一个文件夹。
darknet.exe detector test mydata/my.data mydata/yolov3.cfg backup/yolov3_final.weights -i 0 -thresh 0.25 data/iom/VOCdevkit/VOC2007/JPEGImages/1.jpg
停留在控制台: 项目——属性——配置属性——链接器——系统, 找到子系统选项,其下拉菜单,选择控制台。
darknet.c main -> main_
测试已有视屏:
./darknet detector demo cfg/voc.data cfg/yolo-voc.cfg final_voc.weights your_video_path.mp4
测试时会直接弹出一个窗口播放视屏,可以看是实时检测视屏的效果。
测试摄像头实时检测场景:
./darknet detector demo cfg/voc.data cfg/yolo-voc.cfg final_voc.weights
和测试已有视屏类似,运行该命令后,会调用摄像头,弹出一个窗口显示摄像头拍摄实时场景,并做实时检测。
预测测试集:
./darknet detector valid cfg/voc.data cfg/yolo-voc.cfg final_voc.weights
统计测试集合测试效果:
./darknet detector recall cfg/voc.data cfg/yolo-voc.cfg final_voc.weights
使用Zbar扫描二维码:
1. Zbar官网提供的windows版 只支持32位, 因此64位的机器可以去github下载国外大牛写的64位的Zbar: https://github.com/lineCode/ZBarWin64-1
2. 下载好后在VS中配置, VC++目录 -> 包含目录: Zbar的include, 库目录: lib目录, 链接器 -> 输入: libzbar64-0.lib, 配置好后, 新建项目, 将Zbar64中的 libconv目录下的 .lib .dll 复制到自己项目的.exe下;
3. 关于项目的更详细文章, https://blog.****.net/zt_xcyk/article/details/78006223 https://blog.****.net/zhdnuli/article/details/50427717
--------------------------------linux跨平台-----------------------------------------------
windows项目开发好后需要移植到linux平台: Visual Studio 2015+VisualGDB5.3
https://blog.****.net/RichardWQJ/article/details/79872178
https://www.cnblogs.com/hbccdf/p/use_vs_and_visualgdb_develope_linux_app.html
linxu安装: http://www.cnblogs.com/yaohong/p/7240387.html
改成桥接问题: https://blog.****.net/juliarjuliar/article/details/79455284
注意在配置网关时, 应与主机网关一致, 否则无法连接到外网
vi /etc/hosts
192.168.10.112 pc1. ..
安装cmake:
下载 wget https://cmake.org/files/v3.3/cmake-3.3.2.tar.gz
安装cmake cd cmake-3.3.2
./bootstrap
gmake
make install
安装gcc支持环境
yum -y install gcc
yum -y install gcc-c++
yum -y install gcc gcc-c++ kernel-devel
yum -y install gcc-gfortran
yum -y install subversion
yum -y install gtk*
pkg-config --version
yum -y install libpng-devel
yum -y install zlib-devel
yum -y install libjpeg-devel
yum -y install libtiff-devel
yum -y install libjasper-devel
yum -y install swig
sudo yum -y install libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel libtiff-devel libwebp-devel libdc1394-devel libv4l-devel gstreamer-plugins-base-devel gtk2-devel tbb-devel eigen3-devel gstreamer1-libav gstreamer1-plugins-base-devel java-1.8.0-openjdk-devel python2-numpy ffmpeg-devel ffmpeg-libs.i686 ffmpeg libavdevice.i686 libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel libtiff-devel libwebp-devel libdc1394-devel libv4l-devel gstreamer-plugins-base-devel gtk2-devel tbb-devel eigen3-devel gstreamer1-libav gstreamer1-plugins-base-devel gtk+extra-devel gtk+-devel.i686 cmake pkg-config libgtk libavcodec libavformat libswscale swig
cd opencv目录
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX= /usr/local -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/python2.7/config/libpython2.7.so ..
cmake之后, 发现大量错误
安装python 3.5 https://www.linuxidc.com/Linux/2016-04/129784.htm
安装python 3.5后, 解决yum无法使用的办法 https://blog.****.net/degrade/article/details/52814296
安装 ccache https://blog.****.net/hanlizhong85/article/details/71038515
升级g++版本 http://blog.sina.com.cn/s/blog_64b11b380101f2yb.html
使用c++11编译
g++ -std=c++11 -o test test.cpp
安装numpy yum -y install numpy 如果因为python版本而出现错误 改成#! /usr/bin/python2.7
yum安装还是不行 http://jaist.dl.sourceforge.net/project/numpy/NumPy/1.11.1/ cd 进该目录 python setup.py install 重启
cmake .. 时有些检查Test通不过, 有可能是opencv没删干净; make unistall find / -name "*opencv*" -exec rm -i {} \; find / -name "*cv2.so*" -exec rm -i {} \;
sudo make
sudo make install
经过反复蛋疼的重装, 劝各位还是用ubantu吧, 别用centos了.
linux 安装opencv https://blog.****.net/qq_36449541/article/details/78999581
卸载: https://blog.****.net/xulingqiang/article/details/52496701
g++ test.cpp && ./a.out 结果打印到控制台
https://pjreddie.com/darknet/yolo/