Keras版本的Faster R-CNN源码下载地址:https://github.com/yhenon/keras-frcnn
下载以后,用PyCharm打开(前提是已经安装了Tensorflow-gpu和Keras),打开以后可以看到项目的结构:

修改requirements.txt,设置Keras到已安装的版本,如

Keras==2.0.8

建议版本不要太高,否则会出现错误:

TypeError: softmax() got an unexpected keyword argument 'axis'

然后看看需要运行的文件train_frcnn.py的参数相关代码:

parser.add_option("-p", "--path", dest="train_path", help="Path to training data.")
parser.add_option("-o", "--parser", dest="parser", help="Parser to use. One of simple or pascal_voc",
default="pascal_voc")
parser.add_option("-n", "--num_rois", type="int", dest="num_rois", help="Number of RoIs to process at once.", default=32)
parser.add_option("--network", dest="network", help="Base network to use. Supports vgg or resnet50.", default='vgg')
parser.add_option("--hf", dest="horizontal_flips", help="Augment with horizontal flips in training. (Default=false).", action="store_true", default=False)
parser.add_option("--vf", dest="vertical_flips", help="Augment with vertical flips in training. (Default=false).", action="store_true", default=False)
parser.add_option("--rot", "--rot_90", dest="rot_90", help="Augment with 90 degree rotations in training. (Default=false).",
action="store_true", default=False)
parser.add_option("--num_epochs", type="int", dest="num_epochs", help="Number of epochs.", default=2000)
parser.add_option("--config_filename", dest="config_filename", help=
"Location to store all the metadata related to the training (to be used when testing).",
default="config.pickle")
parser.add_option("--output_weight_path", dest="output_weight_path", help="Output path for weights.", default='./model_frcnn.hdf5')
parser.add_option("--input_weight_path", dest="input_weight_path", help="Input path for weights. If not specified, will try to load default weights provided by keras.")

原来的代码默认的网络是Resnet50,这里改成了VGG。

VOC2007下载地址:https://pjreddie.com/projects/pascal-voc-dataset-mirror/

下载以后解压。由于只下载了VOC2007,需要把pascal_voc_parser.py的语句:

data_paths = [os.path.join(input_path,s) for s in ['VOC2007', 'VOC2012']]

中的VOC2012删掉,否则会报错。

要运行train_frcnn.py还需要下载Resnet50或者VGG的权重文件:

Resnet50下载地址:https://github.com/fchollet/deep-learning-models/releases/download/v0.2/resnet50_weights_tf_dim_ordering_tf_kernels.h5

VGG下载地址:https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5

下载以后解压到相应目录,就可以输入命令运行了:

python train_frcnn.py -p D:\PythonWorkSpace\VOC2007\VOCdevkit --input_weight_path D:\PythonWorkSpace\Models

其中-p后面是VOC2007的路径,--input_weight_path是VGG权重文件的路径。

运行的画面:

运行Keras版本的Faster R-CNN(1)的更多相关文章

  1. faster RCNN(keras版本)代码讲解(3)-训练流程详情

    转载:https://blog.csdn.net/u011311291/article/details/81121519 https://blog.csdn.net/qq_34564612/artic ...

  2. Windows运行常用命令(win+R)

    Windows运行常用命令(win+R) 1.calc: 启动计算器 2.notepad: 打开记事本 3.write: 写字板 4.mspaint: 画图板 5.snippingtool:截图工具, ...

  3. Atitit linux获取项目运行环境版本

    Atitit linux获取项目运行环境版本 1.1. Nginx版本1 1.2. Php版本1 1.3. Mysql版本2 1.4. Redis版本2 1.1. Nginx版本 [root@iZ25 ...

  4. Java-Runoob-高级教程-实例-环境设置实例:4.Java 实例 – 如何查看当前 Java 运行的版本?

    ylbtech-Java-Runoob-高级教程-实例-环境设置实例:4.Java 实例 – 如何查看当前 Java 运行的版本? 1.返回顶部 1. Java 实例 - 如何查看当前 Java 运行 ...

  5. 关于升级.NetCore3.1启动运行项目之后无法运行之前版本的错误解决方案

    昨天在跟上微软的进度,更新VS版本升级.netcore3.1 之后成功运行之后发现,我无法运行之前版本的问题 都是报这种问题: 还有打开解决方案所有的项目都无法正常加载,都是"已卸载&quo ...

  6. 解决Firefox已阻止运行早期版本Adobe Flash

      解决Firefox已阻止运行早期版本Adobe Flash     类别    [随笔分类]web   解决Firefox已阻止运行早期版本Adobe Flash   最近火狐浏览器不知抽什么风, ...

  7. [阿里DIEN] 深度兴趣进化网络源码分析 之 Keras版本

    [阿里DIEN] 深度兴趣进化网络源码分析 之 Keras版本 目录 [阿里DIEN] 深度兴趣进化网络源码分析 之 Keras版本 0x00 摘要 0x01 背景 1.1 代码进化 1.2 Deep ...

  8. visualization of filters keras 基于Keras的卷积神经网络(CNN)可视化

    https://adeshpande3.github.io/adeshpande3.github.io/ https://blog.csdn.net/weiwei9363/article/detail ...

  9. virtualenv 设置虚拟环境来运行不同版本的python

    转自: http://pythonguidecn.readthedocs.io/zh/latest/dev/virtualenvs.html virtualenv 是一个创建隔绝的Python环境的 ...

随机推荐

  1. HDU 1175 连连看 (DFS+剪枝)

    <题目链接> 题目大意:在一个棋盘上给定一个起点和终点,判断这两点是否能通过连线连起来,规定这个连线不能穿过其它的棋子,并且连线转弯不能超过2次. 解题分析:就是DFS从起点开始搜索,只不 ...

  2. ZOJ 1940 Dungeon Master【三维BFS】

    <题目链接> 题目大意: 在一个立体迷宫中,问你从起点走到终点的最少步数. 解题分析: 与普通的BFS基本类似,只需要给数组多加一维,并且走的时候多加 上.下这两个方向就行. #inclu ...

  3. 二叉搜索树的java实现

    转载请注明出处 一.概念 二叉搜索树也成二叉排序树,它有这么一个特点,某个节点,若其有两个子节点,则一定满足,左子节点值一定小于该节点值,右子节点值一定大于该节点值,对于非基本类型的比较,可以实现Co ...

  4. python数据结构之冒泡排序

    冒泡排序是一种基础排序算法,在python中,我们利用列表的的方式来完成,它对列表中的元素进行重复的遍历,在遍历的同时进行比较,如果两个数没有按照我们规定的顺序进行排列,就按照我们预先设定好的是顺序或 ...

  5. 利用cookie实现iframe刷新时停留在当前页面

    这段时间第一次用iframe,发现问题还挺多,这次主要解决了一个用cookie实现iframe刷新时停留在当前页面,具体步骤如下: 1.必须在每一个页面中记录下当前的url并存入cookie中,具体代 ...

  6. DWM1000 定位数据收发以及定位算法

    蓝点DWM1000 模块已经打样测试完毕,有兴趣的可以申请购买了,更多信息参见 蓝点论坛 正文: DWM1000 定位数据 官方定位程序,建议先学习基础API程序 参考手册: 在手册上提到,目前双向定 ...

  7. python 文件指针及文件覆盖

    1.文件纯净模式延伸 r+t:可读.可写 w+t:可写.可读with open('b.txt','w+t',encoding='utf-8') as f: print(f.readable()) pr ...

  8. jquery 学习 总结

    OM = Document Object Model(文档对象模型) 一.基础 1.    <script src="http://cdn.static.runoob.com/libs ...

  9. PAT Basic 1004

    1004 成绩排名 (20 分) 读入 n(>0)名学生的姓名.学号.成绩,分别输出成绩最高和成绩最低学生的姓名和学号. 输入格式: 每个测试输入包含 1 个测试用例,格式为 第 1 行:正整数 ...

  10. 使用iscroll,无法正常滑动的原因

    iscroll的dom元素的结构是固定的,swiper是容器,scroll是需要滚动的容器,list是滚动的内容 <div class="swiper"> <di ...