加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo_kitti2AU.py 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Mads Dyrmann
"""
import kitti
import pandas as pd
import os
CROPBBOXTOIMAGE = True
kittidir = '/mnt/AU_BrugerDrev/Database/GetThumbnailsFromServerForDetection_242_326_336_249_250_279_2018-05-22/LocalizationAnnotationsOnedir/KittiAnnotations'
exportdir = '/mnt/AU_BrugerDrev/Database/GetThumbnailsFromServerForDetection_242_326_336_249_250_279_2018-05-22/LocalizationAnnotationsOnedir/AUAnnotations'
annotationFiles = []
for root, dirnames, filenames in os.walk(kittidir):
for filename in filenames:
if filename.lower().endswith(('.txt')):
annotationFiles.append(os.path.join(root, filename))
imsize = {'width':2448,
'height':2048,
'depth':3}
def createIfNotExist(directory):
if not os.path.exists(directory):
os.makedirs(directory)
createIfNotExist(exportdir)
for annotationFile in annotationFiles:
with open(annotationFile,'r') as fid:
annotationlist = fid.readlines()
AUannotationList = kitti.kitti2AU(annotationlist, filename=None)
df = pd.DataFrame(AUannotationList)
filename, ext = os.path.splitext(os.path.basename(annotationFile))
df.to_csv(os.path.join(exportdir,filename+'.csv'),sep=';')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化