# Cityscape_yolov5
将Cityscape数据集转化为yolov5格式后,适配街景道路的目标检测任务
## Datasets:
> Cityscape数据集官网下载链接:https://www.cityscapes-dataset.com/news/
>
> Cityscape数据集个人网盘链接:链接: https://pan.baidu.com/s/1njtEAV11gs_ZWhtelB1iZw? 提取码: x5kx
## Use:
1. create new dic,解压下载文件到新目录下,并将文件重命名
```shell
mkdir ./cityscape
unzip gtFine_trainvaltest.zip -d ./cityscape
mv ./gtFine_trainvaltest ./getfine
mv ./leftImg8bit_trainvaltest ./leftImg8bit
```
2. 在当前目录下进行数据处理
```shell
mv handle.py ./cityscape
python handle.py
```
3. 生成images和labels目录
4. 提取labels中的class的顺序 (Recommend)
* __由于生成的class顺序不一定一样,推荐用以下方法读取自己的顺序__
```python
path = './cityscape/labels/classes.txt'
tmp = []
with open(path, "r") as f:
for _ in f:
tmp.append(_.replace('\n',''))
print(tmp)
```
```shell
['rectification border', 'road', 'sidewalk', ··· , 'ridergroup', 'truckgroup'] # class names
```
5. 创建cityscape.yaml并写入以下内容
```shell
path: ../cityscape # dataset root dir
train: images/train # train images (relative to 'path') 118287 images
val: images/val # val images (relative to 'path') 5000 images
test: images/test
# Classes
nc: 38 # number of classes
names: ['rectification border', 'road', 'sidewalk', ··· , 'ridergroup', 'truckgroup'] # class names #把自己上面生成的复制进来!
```
6. 将cityscape.yaml复制到./yolov5/data中
至此,完成数据集的准备工作
7. Benchmark
__mAP = 42.25(Full classes)__
好家伙VCC
- 粉丝: 1790
- 资源: 9088
最新资源
- f13b0fd5eq9352b28b6309177764c804.apk
- x64WinQSB安装程序v4.1
- 2023-04-06-项目笔记 - 第二百八十四阶段 - 4.4.2.282全局变量的作用域-282 -2025.10.12
- 数据集-目标检测系列- 降落伞 滑翔机 检测数据集 glider >> DataBall
- 数据集-目标检测系列- 战斗机 检测数据集 fighter-plane >> DataBall
- mybatis-plus代码生成自定义templates
- 数据集-目标检测系列- 手提包 检测 检测数据集 hand bag>> DataBall
- 自动化车间安全生产服务的标准制定与应用指南
- 520必备!这些Python表白代码祝你脱单成功,⼀、浪漫玫瑰花、⼆、浪漫玫瑰加爱⼼、三、⼼⼼相印、四、粉嫩爱⼼、五、丘⽐特⼀键
- 实现无线定位-chan算法,完整代码,适合参考学习使用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈