ssd-caffe中的annotationDatum数据结构

这篇博客讲解的非常好,我这里只是搬运和总结

SSD目标检测lmdb数据结构剖析

先看一张图,完美解释了AnnotationDatum的数据结构。

 

um的数据结,SSD读取数据,需要将label和图片封装到一个数据结构下,这时候老版本caffe的Datum数据结构不够用了

我们来看看caffe-ssd的 AnnotatedDatum数据

先看 caffe.proto文件(protubuf,不懂的得先了解一下protobuf)

// The normalized bounding box [0, 1] w.r.t. the input image size.
message NormalizedBBox {
  optional float xmin = 1;
  optional float ymin = 2;
  optional float xmax = 3;
  optional float ymax = 4;
  optional int32 label = 5;
  optional bool difficult = 6;
  optional float score = 7;
  optional float size = 8;
}

// Annotation for each object instance.
message Annotation {
  optional int32 instance_id = 1 [default = 0];
  optional NormalizedBBox bbox = 2;
}

// Group of annotations for a particular label.
message AnnotationGroup {
  optional int32 group_label = 1;
  repeated Annotation annotation = 2;
}

// An extension of Datum which contains "rich" annotations.
message AnnotatedDatum {
  enum AnnotationType {
    BBOX = 0;
  }
  optional Datum datum = 1;
  // If there are "rich" annotations, specify the type of annotation.
  // Currently it only supports bounding box.
  // If there are no "rich" annotations, use label in datum instead.
  optional AnnotationType type = 2;
  // Each group contains annotation for a particular class.
  repeated AnnotationGroup annotation_group = 3;
}

我们可以看到,AnnotationDatum下包含AnnotationType、Datum和AnnotationGroup三个结构

其中Datum结构用于存放图片信息,和老版本caffe的Datum是一样的,.

AnnotationGroup里面包含grouplabel和Annotation结构

Annotation结构里又包含 instance_id和NormalizedBBox结构

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值