bottom-up attention features代码的一些笔记

mscoco 数据集的bottom-up attention的特征(目标检测的框对应的特征)
trainval_resnet101_faster_rcnn_genome_36.tsv 或者 trainval_resnet101_faster_rcnn_genmoe.tsv

下载地址为 https://github.com/peteanderson80/bottom-up-attention#demo
在这里插入图片描述
.tsv文件中数据格式如下

FIELDNAMES = ['image_id', 'image_w','image_h','num_boxes', 'boxes', 'features']
其中item['boxes']为对应检测框的位置信息 x,y,w,h
item[''boxes'].shape=(num_boxes,4)
item['features']为对应检测框 在pool5_flat 层的特征
item['features'].shape=(num_boxes, feature_dim)
item['num_boxes'] 为该张图片对应的检测框数目
注意到源码中写到
 return {
        'image_id': image_id,
        'image_h': np.size(im, 0),
        'image_w': np.size(im, 1),
        'num_boxes' : len(keep_boxes),
        'boxes': base64.b64encode(cls_boxes[keep_boxes]),
        'features': base64.b64encode(pool5[keep_boxes])
    }   
   所以在读取 .tsv文件是,需要用到base64.decodestring()解码

可以参考 https://github.com/peteanderson80/bottom-up-attention/blob/master/tools/generate_tsv.py获取这些信息的详细由来过程

感谢苏璐岩小姐姐

评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值