GOTURN安装教程
官方教程:https://github.com/davheld/GOTURN
0.安装一些依赖:
- 安装CMake:
sudo apt-get install cmake
- 安装caffe:http://caffe.berkeleyvision.org/installation.html
- 安装OpenCV:
sudo apt-get install libopencv-dev
- 安装TinyXML:
sudo apt-get install libtinyxml-dev
1.下载GOTURN:
git clone https://github.com/davheld/GOTURN.git
2.编译:
到GOTURN文件夹下:
mkdir build
cd build
cmake ..
make
错误处理
PS:安装了两次GOTURN,遇到的基本都是下面几个问题。
0.cmake .. error:
问题: caffe目录未找到
Caffe_DIR is /home/your dir/benchmark/caffe-master/build/
Caffe_INCLUDE_DIRS is /home/your dir/benchmark/caffe-master/include/caffe
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
解决方法:到GOTURN-master/cmake/Modules文件夹下,FindCaffe.cmake文件,修改一下其中caffe的路径就可以了:
注意,使用的是你自己caffe的路径
set(Caffe_DIR /home/embedded/caffe)
PS:在CMakeList.txt中,有如下一段话:
find_package(Caffe REQUIRED)
# If Caffe not found, configure line 5 of cmake/Modules/FindCaffe.cmake
# If that fails uncomment the two lines below and set paths manually
# set(Caffe_DIR /path_to_caffe/build/install)
# set(Caffe_INCLUDE_DIRS /path_to_caffe/build/install/include)
不知道只是在这里设置一下caffe的安装路径行不行,可以尝试一下。
1.make error1:
问题: caffe.pb.h:No such file or directory
解决方法:
一般这个问题是因为在编译caffe的时候,就没有生成这个文件。
用protoc从caffe/src/caffe/proto/caffe.proto生成caffe.pb.h和caffe.pb.cc
cd ~/caffe/src/caffe/proto
protoc --cpp_out=/home/your dir/caffe/include/caffe/ caffe.proto
到caffe/include/caffe/下查看生成的caffe.pb.h和caffe.pb.cc;
在caffe/include/caffe/下创建文件夹proto,将caffe.pb.h和caffe.pb.cc移动到该文件夹下,然后回到GOTURN/build下make,发现这个问题已经解决。
2.make error2:
问题: recipe for target 'test_tracker_alov' failed
解决方法:这个问题是因为没有安装trax,这时需要下载trax并编译:
git clone https://github.com/votchallenge/trax.git
cd trax-master
mkdir build
cd build
cmake ..
make
打开/GOTURN下的CMakeList.txt,在
add_executable (test_tracker_vot src/test/test_tracker_vot.cpp)
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS} ${Caffe_LIBRARIES} ${GLOG_LIB})
target_link_libraries (test_tracker_vot ${PROJECT_NAME})
后面添加trax的路径:
target_link_libraries(${PROJECT_NAME} /home/xpf/task1/trax-master/build/libtrax.so)
注:使用自己的路径
以上问题都解决后,到/GOTURN/build下,重新make即可。这里建议sudo make
或者sudo make all
,这样编译后文件生成的比较全。
之后,便可以按照官方git上的教程下载预训练好的模型,然后运行脚本查看GOTURN在其测试集VOT2014上的追踪结果啦。