Faster R-CNN 源码解读(Tensorflow版)

github源码地址:https://github.com/endernewton/tf-faster-rcnn
阅读源码时应该先找出主干的函数,整理出框架,然后再依据需要去细读各个函数的功能。

1.代码框架:

以tf-faster-rcnn-master/tools/demo.py作为程序入口,主要调用tf-faster-rcnn-master/lib/nets/network.py 、 tf-faster-rcnn-master/lib/nets/resnet_v1.py (若以resnet作为backbone的话)和 tf-faster-rcnn-master/lib/model/test.py中的函数。其中network.py中的类Network 是 resnet_v1.py中的Resnetv1 的父类。

if name == ‘main’:

  • net = resnetv1(~)
  • net.create_architecture(~)
    • rois, cls_prob, bbox_pred = self._build_network(~)
      • net_conv = self._image_to_head(~)
        • net_conv = self._build_base()
          • net = resnet_utils.conv2d_same(self._image, ~)
        • net_conv, _ = resnet_v1.resnet_v1(net_conv, ~)
      • rois = self._region_proposal(net_conv, ~)
      • pool5 = self._crop_pool_layer(net_conv, ~)
      • fc7 = self._head_to_tail(pool5, ~)
      • cls_prob, bbox_pred = self._region_classification(fc7, ~)
  • saver.restore(sess, tfmodel)
  • demo(sess, net, im_name)
    • scores, boxes = im_detect(sess, net, im)
      • _, scores, bbox_pred, rois = net.test_image(sess, blobs~)
        • cls_score, cls_prob, bbox_pred, rois = sess.run(~)

2. 代码详解

待续。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值