(六)可视化KITTI标注的2D检测框

一、KITTI 标注文件格式

        在以下网址下载已经标注好的文件,里面有20个场景的标注文件。寻找与自己对应场景的文件。比如我对应的为文档里的0004.txt 。
  可以从https://blog.csdn.net/qq_29931083/article/details/106460698 这里下载
  在这里插入图片描述
        通过Tracking里的README可以看到文本记录的格式https://blog.csdn.net/qq_29931083/article/details/106504415


Values      Name      Description

1      frame      Frame within the sequence where the object appearers
1     track id      Unique tracking id of this object within this sequence
1      type      Describes the type of object: ‘Car’, ‘Van’, ‘Truck’, ‘Pedestrian’, ‘Person_sitting’, ‘Cyclist’, ‘Tram’, ‘Misc’ or ‘DontCare’
1      truncated      Integer (0,1,2) indicating the level of truncation.Note that this is in contrast to the object detection benchmark where truncation is a float in [0,1].
1     occluded     Integer (0,1,2,3) indicating occlusion state:
          0 = fully visible, 1 = partly occluded
          2 = largely occluded, 3 = unknown
1     alpha      Observation angle of object, ranging [-pi…pi]
4      bbox     2D bounding box of object in the image (0-based index):
            contains left, top, right, bottom pixel coordinates
3    dimensions    3D object dimensions: height, width, length (in meters)
3    location     3D object location x,y,z in camera coordinates (in meters)
1    rotation_y     Rotation ry around Y-axis in camera coordinates [-pi…pi]
1     score     Only for results: Float, indicating confidence in detection, needed for p/r curves, higher is better.


二、画出2D检测框

        使用jupyter notebook进行调试,将文件导入查看文件内容:
        其中包括了每一帧的帧序号frame;每一个物体特有的id track_id;2D 检测框记录的数据:bbox_lift,bbox_top,bbox_right,bbox_bottom;

import pandas as pd

Columns_name = ['frame','track_id','type','truncated','occluded','alpha','bbox_lift','bbox_top','bbox_right','bbox_bottom','height','width','length','pos_x','pos_y','pos_z','rot_y']
df = pd.read_csv('/home/liqi/dev/catkin_ws/src/KITTI_tutorials/2011_09_26_drive_0014_sync/training/label_02/0004.txt',header = None,sep = ' ')

df.columns = Columns_name

df.head()

在这里插入图片描述

        其中的frame与资料集中的文件相对应,如第0帧 即frame 为0时,可对应下图有4辆car和一辆Van。
在这里插入图片描述
        为了后续的方便 将 type 中的’Van’,‘Truck’,‘Tram’ 都转为 Car,使用以下语句,首先使用df.type.isin() 定位出’Van’,‘Truck’,‘Tram’ 是否在type中;显示为True的通过df.loc[ ,’type’] =’Car’ 定位 并将其中的的type类型改为Car

df.loc[df.type.isin(['Van','Truck','Tram']),'type']='Car'

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值