開源Fast R-CNN代碼實現物體識別

參考鏈接:https://blog.csdn.net/linolzhang/article/details/70306003

1.資源鏈接

代碼下載鏈接:https://github.com/CharlesShang/TFFRCNN

訓練好的網絡下載鏈接:

 在 TFFRCNN-master 下新建文件夾 model,存放要下載入的 net(參考 Github 下載地址),推薦下載:

    2.VGG16 - TFFRCNN (0.689 mAP on VOC07):https://drive.google.com/file/d/0B_xFdh9onPagX0JWRlR0cTZ5OGc/view

    3.VGG16 - TFFRCNN (0.748 mAP on VOC07):https://drive.google.com/file/d/0B_xFdh9onPagVmt5VHlCU25vUEE/view

    5.Resnet50 - TFFRCNN (0.712 mAP on VOC07):https://drive.google.com/file/d/0B_xFdh9onPagbXk1b0FIeDRJaU0/view

2.Requirements: software

  1. Requirements for Tensorflow (see: Tensorflow)

  2. Python packages you might not have: cython, python-opencv, easydict (recommend to install: Anaconda

3.Requirements: hardware

 

  1. For training the end-to-end version of Faster R-CNN with VGG16, 3G of GPU memory is sufficient (using CUDNN)

4.Installation (sufficient for the demo)

       1.Clone the Faster R-CNN repository

                       git clone https://github.com/CharlesShang/TFFRCNN.git

      2.Build the Cython modules

           cd TFFRCNN/lib
           make # compile cython and roi_pooling_op, you may need to modify make.sh for your platform

    我在編譯過程中遇到了一些錯誤需要修改lib/make.sh文件(修改如下圖紅色部分), 我的文件內容如下:

-----     Begin   ------

#!/usr/bin/env bash
TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())')
echo $TF_INC

TF_LIB=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())')
echo $TF_LIB

CUDA_PATH=/usr/local/cuda/

cd roi_pooling_layer

/usr/local/cuda-9.0/bin/nvcc -std=c++11 -c -o roi_pooling_op.cu.o roi_pooling_op_gpu.cu.cc \
        -I $TF_INC -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -arch=sm_52

## if you install tf using already-built binary, or gcc version 4.x, uncomment the two lines below
#g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o roi_pooling.so roi_pooling_op.cc \
#       roi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64

# for gcc5-built tf
#g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=1 -o roi_pooling.so roi_pooling_op.cc \
g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o roi_pooling.so roi_pooling_op.cc \
        roi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64 -L/usr/local/lib/python2.7/dist-packages/tensorflow -ltensorflow_framework \
        -L/usr/local/cuda-9.0/targets/x86_64-linux/lib/ -L$TF_LIB

cd ..

# add building psroi_pooling layer
cd psroi_pooling_layer
/usr/local/cuda-9.0/bin/nvcc -std=c++11 -c -o psroi_pooling_op.cu.o psroi_pooling_op_gpu.cu.cc \
        -I $TF_INC -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -arch=sm_52

g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o psroi_pooling.so psroi_pooling_op.cc \
        psroi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64i -L/usr/local/lib/python2.7/dist-packages/tensorflow -ltensorflow_framework \
        -L/usr/local/cuda-9.0/targets/x86_64-linux/lib/ -L$TF_LIB

## if you install tf using already-built binary, or gcc version 4.x, uncomment the two lines below
#g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o psroi_pooling.so psroi_pooling_op.cc \
#       psroi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64

cd ..

-----     End    -----

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章