开源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    -----

 

 

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值