Faster RCNN pytorch 復現
阿新 • • 發佈:2018-12-10
1.Install the requirements
pip install pyyaml sympy h5py cython numpy scipy menpo
·install opencv3
1.1 Update packages
sudo apt-get update
sudo apt-get upgrade
1.2 Install OS libraries
Remove any previous installations of x264</h3> sudo apt-get remove x264 libx264-dev We will Install dependencies now sudo apt-get install build-essential checkinstall cmake pkg-config yasm sudo apt-get install git gfortran sudo apt-get install libjpeg8-dev libjasper-dev libpng12-dev # If you are using Ubuntu 14.04 sudo apt-get install libtiff4-dev # If you are using Ubuntu 16.04 sudo apt-get install libtiff5-dev sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev sudo apt-get install libxine2-dev libv4l-dev sudo apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev sudo apt-get install qt5-default libgtk2.0-dev libtbb-dev sudo apt-get install libatlas-base-dev sudo apt-get install libfaac-dev libmp3lame-dev libtheora-dev sudo apt-get install libvorbis-dev libxvidcore-dev sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev sudo apt-get install x264 v4l-utils # Optional dependencies sudo apt-get install libprotobuf-dev protobuf-compiler sudo apt-get install libgoogle-glog-dev libgflags-dev sudo apt-get install libgphoto2-dev libeigen3-dev libhdf5-dev doxygen
1.3 Download OpenCV and OpenCV_contrib
1.3.1 Download opencv from Github
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 3.3.1
cd ..
1.3.2 Download opencv_contrib from Github
git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout 3.3.1
cd ..
1.4 Compile and install OpenCV with contrib modules
1.4.1 Create a build directory
cd opencv
mkdir build
cd build
1.4.2 Run CMake
cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D WITH_TBB=ON \ -D WITH_V4L=ON \ -D WITH_QT=ON \ -D WITH_OPENGL=ON \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \ -D BUILD_EXAMPLES=ON ..
1.4.3 Compile and Install
# find out number of CPU cores in your machine
nproc
# substitute 4 by output of nproc
make -j4
sudo make install
sudo sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
2.Clone the Faster R-CNN repository
git clone https://github.com/longcw/faster_rcnn_pytorch.git
3.Build the Cython modules for nms and the roi_pooling layer
cd faster_rcnn_pytorch/faster_rcnn
./make.sh
5.set image in the “demo” : 0.00545.jpg
如有不當,請指教;如有疑問,歡迎留言交流~