【数据集】LaRa交通灯数据集解析
交通标志和信号灯数据集有TT100K(清华腾讯100K数据集)、中国交通标志检测数据集CCTSDB、 Bosch Small Traffic Lights Dataset(BSTLD).
交通信号灯检测系统的数据集有很多,其中包括:
-
LISA: Traffic Light Dataset:由美国加州大学伯克利分校的交通实验室(LISA)提供的数据集,包括交通信号灯的图像和视频,涵盖多种天气和时间条件。
-
Bosch Small Traffic Lights Dataset: 由德国博世公司提供的数据集,包括城市街道上的交通信号灯图像和视频,注重复杂的交通场景。
-
KAIST Multi-Spectral Pedestrian Detection Benchmark:由韩国科学技术院(KAIST)提供的多光谱数据集,其中包括红、黄、绿三种颜色的交通信号灯图像。
Lara转yolov5可用的数据集;
code: Lara2coco128;

# YOLOv5 🚀 by Ultralytics, GPL-3.0 license # Lara dataset http://www.lara.prd.fr/benchmarks/trafficlightsrecognition # Example usage: python train.py --data VisDrone.yaml # parent # ├── yolov5 # └── datasets # └── VisDrone ← downloads here (2.3 GB) # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..] # path: /media/uuuuu/mobile_disk/workspace/zzz/dataset/traffic_light/Lara_UrbanSeq1_JPG # dataset root dir # train: images # train images (relative to 'path') images # val: images # val images (relative to 'path') images # test: images # test images (optional) images # # # Classes # nc: 4 # number of classes # names: ['go', 'stop', 'warning', 'ambiguous'] # # names: ['green', 'red', 'orange', 'ambiguous'] #Lara File format is as follows: #Timestamp / frameindex x1 y1 x2 y2 id 'type' 'subtype' import os # from pathlib import Path import shutil def convert_box(size, box): # Convert Lara box to YOLO xywh box dw = 1. / size[0] dh = 1. / size[1] xc = ((box[0] + box[2])/2)*dw yc = ((box[1] + box[3])/2)*dh w = (box[2]-box[0])*dw h = (box[3]-box[1])*dh return xc, yc, w, h def lara2yolo(path): # Path(dir / 'labels').rmdir() # Path(dir / 'images').rmdir() # (dir / 'labels').mkdir(parents=True, exist_ok=True) # make labels directory # (dir / 'images').mkdir(parents=True, exist_ok=True) # make images directory shutil.rmtree(os.path.join(path, 'labels'), ignore_errors=True) shutil.rmtree(os.path.join(path, 'images'), ignore_errors=True) os.mkdir(os.path.join(path, 'labels')) os.mkdir(os.path.join(path, 'images')) gt = open('Lara_UrbanSeq1_GroundTruth_GT.txt', 'rt') lines = gt.readlines() img_size = (640, 480) # (w, h) for i in range(13, len(lines)): line = lines[i].split() index = line[2] imgname = 'frame_' + index.zfill(6) + '.jpg' # cls = int(line[7]) # id subcls = line[10] global cls if subcls == 'go': cls = 0 elif subcls == 'stop': cls =1 elif subcls == 'warning': cls =2 elif subcls == 'ambiiguous': cls =3 else: cls =3 box = convert_box(img_size, tuple(map(int, line[3:7]))) info = f"{cls} {' '.join(f'{x:.6f}' for x in box)}\n" labelname = './labels/' + imgname.replace('jpg', 'txt') imagepath = './Lara_UrbanSeq1_JPG/Lara3D_UrbanSeq1_JPG/' + imgname # copy images shutil.copy(imagepath, './images/') labelfile = open(labelname, 'a+') labelfile.write(info) labelfile.close() if __name__ == "__main__": # Convert path = './dataset/traffic_light/Lara_UrbanSeq1_JPG' # dir = Path(path) lara2yolo(path) # convert Lara_Urban annotations to YOLO labels
参考
1. Lara_dataset;
3. github_yolov5;
完
各美其美,美美与共,不和他人作比较,不对他人有期待,不批判他人,不钻牛角尖。
心正意诚,做自己该做的事情,做自己喜欢做的事情,安静做一枚有思想的技术媛。
版权声明,转载请注明出处:https://www.cnblogs.com/happyamyhope/
心正意诚,做自己该做的事情,做自己喜欢做的事情,安静做一枚有思想的技术媛。
版权声明,转载请注明出处:https://www.cnblogs.com/happyamyhope/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
2021-06-16 【CV基础】基于Pytorch-Unet训练二类别分割并测试
2021-06-16 【CV基础】基于Pytorch-Unet训练多类别分割并测试
2021-06-16 【linux基础】Ubuntu下实时查看显卡使用信息