出于project的需要,不仅要detect和classify对象,还希望建立不同class的对象之间的关系,进行所谓的pair-matching。

需要完成以下几步:

1. dataset中label的增加:

在自定义的dataset类中,方法_load_XXX_annotation(self, index) 增加 gt_pair 这个annotation:

./lib/datasets/bar_noGroup.py:172: gt_pair = np.zeros((num_objs), dtype=np.int32) # for pair-matching algorithm
./lib/datasets/bar_noGroup.py:198: gt_pair[ix] = int(obj.find('ind_class'))
./lib/datasets/bar_noGroup.py:207: 'gt_pair': gt_pair,

2.

lib/layer_utils/proposal_target_layer.py:21:def proposal_target_layer(rpn_rois, rpn_scores, gt_boxes, gt_texts, gt_pair, _num_classes):
lib/layer_utils/proposal_target_layer.py:49: labels, texts, pair, rois, roi_scores, bbox_targets, bbox_inside_weights = _sample_rois(
lib/layer_utils/proposal_target_layer.py:50: all_rois, all_scores, gt_boxes, gt_texts, gt_pair, fg_rois_per_image,
lib/layer_utils/proposal_target_layer.py:60: return rois, roi_scores, labels,texts, pair, Variable(bbox_targets), Variable(bbox_inside_weights), Variable(bbox_outside_weights)
lib/layer_utils/proposal_target_layer.py:107:def _sample_rois(all_rois, all_scores, gt_boxes, gt_texts, gt_pair, fg_rois_per_image, rois_per_image, num_classes):
lib/layer_utils/proposal_target_layer.py:119: pair = [gt_pair[i] for i in gt_assignment]
lib/layer_utils/proposal_target_layer.py:120: print('pair:')
lib/layer_utils/proposal_target_layer.py:121: print(pair)
lib/layer_utils/proposal_target_layer.py:153: pair = [pair[i] for i in keep_inds]
lib/layer_utils/proposal_target_layer.py:167: return labels, texts, pair, rois, roi_scores, bbox_targets, bbox_inside_weights

3.

lib/nets/network.py:215: rois, roi_scores, labels,texts,pair, bbox_targets, bbox_inside_weights, bbox_outside_weights = \
lib/nets/network.py:217: rois, roi_scores, self._gt_boxes, self._gt_texts, self._gt_pair, self._num_classes)
lib/nets/network.py:222: self._proposal_targets['pair'] = pair
lib/nets/network.py:228: if (k != 'texts') and (k != 'pair'):
lib/nets/network.py:293: pair_targets = self._proposal_targets['pair']
lib/nets/network.py:294: #print(pair_targets)
lib/nets/network.py:522: def forward(self, image, im_info, gt_boxes=None, gt_texts=None, gt_pair=None, mode='TRAIN'):
lib/nets/network.py:534: self._gt_pair = gt_pair
lib/nets/network.py:601: blobs['gt_texts'], blobs['gt_pair'])
lib/nets/network.py:610: blobs['gt_texts'], blobs['gt_pair'])
lib/nets/network.py:629: blobs['gt_texts'], blobs['gt_pair'])

4.

lib/roi_data_layer/minibatch.py:50: blobs['gt_pair'] = [roidb[0]['gt_pair'][i] for i in gt_inds]

faster-RCNN 加入新的Ground Truth的更多相关文章

  1. Faster R-CNN利用新的网络结构来训练

    前言 最近利用Faster R-CNN训练数据,使用ZF模型,效果无法有效提高.就想尝试对ZF的网络结构进行改造,记录下具体操作. 一.更改网络,训练初始化模型 这里为了方便,我们假设更换的网络名为L ...

  2. AI佳作解读系列(二)——目标检测AI算法集杂谈:R-CNN,faster R-CNN,yolo,SSD,yoloV2,yoloV3

    1 引言 深度学习目前已经应用到了各个领域,应用场景大体分为三类:物体识别,目标检测,自然语言处理.本文着重与分析目标检测领域的深度学习方法,对其中的经典模型框架进行深入分析. 目标检测可以理解为是物 ...

  3. faster rcnn讲解很细

    https://blog.csdn.net/bailufeiyan/article/details/50749694 https://www.cnblogs.com/dudumiaomiao/p/65 ...

  4. 第三十一节,目标检测算法之 Faster R-CNN算法详解

    Ren, Shaoqing, et al. “Faster R-CNN: Towards real-time object detection with region proposal network ...

  5. faster rcnn相关内容

    转自: https://zhuanlan.zhihu.com/p/31426458 faster rcnn的基本结构 Faster RCNN其实可以分为4个主要内容: Conv layers.作为一种 ...

  6. 论文阅读笔记二十七:Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks(CVPR 2016)

    论文源址:https://arxiv.org/abs/1506.01497 tensorflow代码:https://github.com/endernewton/tf-faster-rcnn 室友对 ...

  7. faster rcnn 详解

    转自:https://zhuanlan.zhihu.com/p/31426458 经过R-CNN和Fast RCNN的积淀,Ross B. Girshick在2016年提出了新的Faster RCNN ...

  8. [转]CNN目标检测(一):Faster RCNN详解

    https://blog.csdn.net/a8039974/article/details/77592389 Faster RCNN github : https://github.com/rbgi ...

  9. Faster R-CNN论文详解 - CSDN博客

    废话不多说,上车吧,少年 paper链接:Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks ...

随机推荐

  1. AcWing 841. 字符串哈希

    //快速判断两次字符串是不是相等 #include<bits/stdc++.h> using namespace std ; typedef unsigned long long ULL; ...

  2. HDU 6631 line symmetric 计算几何

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6631 题意:共\(T\)组数据,每组数据给出\(n\)个点的坐标,这\(n\)个点按顺序给出,相邻的点 ...

  3. 「JSOI2015」圈地

    「JSOI2015」圈地 传送门 显然是最小割. 首先对于所有房子,权值 \(> 0\) 的连边 \(s \to i\) ,权值 \(< 0\) 的连边 \(i \to t\) ,然后对于 ...

  4. MongoDB - 用户名密码认证

    参考 offical doc medium Mongo roles说明 https://docs.mongodb.com/manual/reference/built-in-roles/#userAd ...

  5. linux使用wget下载https开头url的文件

    可以使用命令 : 比如我们可以修改成: wget --no-check-certificate https://我们下载文件路径 来自: http://www.laozuo.org/3648.html

  6. 包、logging模块、hashlib模块、openpyxl模块、深浅拷贝

    包.logging模块.hashlib模块.openpyxl模块.深浅拷贝 一.包 1.模块与包 模块的三种来源: 1.内置的 2.第三方的 3.自定义的 模块的四种表现形式: 1.py文件 2.共享 ...

  7. oracle 多表查询,请教个问题

    首先,是有一个合同表,对应数据库表 lg_bill_of_lading_detail  简称 bold    有一个用户表 EMT_USER 简称 e 合同审批 后,合同表里  会有一个审核人AUDI ...

  8. (一)tensorflow-gpu2.0学习笔记之开篇(cpu和gpu计算速度比较)

    摘要: 1.以动态图形式计算一个简单的加法 2.cpu和gpu计算力比较(包括如何指定cpu和gpu) 3.关于gpu版本的tensorflow安装问题,可以参考另一篇博文:https://www.c ...

  9. WCF全面解析之 第四讲 使用代码 部署服务

    关键代码: ServiceHost host = null; //启动 private void button1_Click(object sender, EventArgs e) { host=ne ...

  10. 解决 IDEA 下 struts.xml 中 extends="struts-default" 报红的问题

    现象 在IDEA中配置struts.xml时 extends="struts-default" 报红,配置拦截器时属性无预选项提示,也爆红. struts.xml本身的配置并没有错 ...