CARLARain是一个支持复杂光照环境雨景模拟的自动驾驶模拟器框架,基于CARLA实现了驾驶场景的 环境仿真、车辆仿真和行人仿真,并结合HRIGNet和CRIGNet,引入了复杂光照环境下可控且逼真的雨景模拟。该框架可为自动驾驶视觉感知算法构建丰富的雨景仿真训练环境,涵盖多样的时间段和光照条件,满足自动驾驶场景下的语义分割、实例分割、深度估计和目标检测等多个任务的需求。
configs
:配置文件CarRain
:CARLA客户端代码,用于获取CARLA模拟的背景RGB图、语义分割图、实例分割图、深度图和物体边界框CRIGNet
:CRIGNet代码,用于生成低分辨率雨纹图像RainControlNet
:RainControlNet代码,用于将低分辨率雨纹图像扩大为高分辨率雨纹图像HRIGNet
:HRIGNet代码,根据背景RGB图像和雨纹图像生成雨景图像data
:输出数据路径
- CARLA:下载CARLA服务器,新建
carla
conda环境并配置CARLA client library - ControlNet:
cd RainControlNet && conda env create -f environment.yaml
- HRIGNet:
cd HRIGNet && conda env create -f environment.yaml
- 所有模型权重文件可在此获得:BaiduCloud (提取码:i4zi)
- CRIGNet模型权重:下载
CRIGNet/00000-crig_fastgan_g1w0.5_rainTrainL_256-FastGAN
并解压至CRIGNet/log_raintrainl_256
- RainControlNet模型权重:下载
RainControlNet/crig_hint256-128_out512_4xgrad_1e-4-2024-10-05-T07-21-55
并解压至RainControlNet/logs
- HRIGNet模型权重:下载
HRIGNet/2023-10-19T19-31-52_blender-gdm-rainlayer-hw512-f4-em3
和2023-10-21T21-50-57_blender-hrig-rainlayer+masked-gdm512-hw512-hybrid-unet128-em3
并解压至HRIGNet/logs
- 参考
configs/seqTest.yaml
,具体内容解释见Docs/config.md
-
运行CARLA server:
- 在CARLA目录下执行
./CarlaUE4.sh -RenderOffScreen -quality-level=Epic
- 配置
CarRain/config.py
中的serverIP
和serverPort
- 在CARLA目录下执行
-
激活conda环境:
conda activate carla
-
运行CARLA client,获取背景RGB图、语义分割图、实例分割图、深度图和物体边界框:
python CarRain/main.py -c configs/seqTest.yaml
-
获取目标检测数据:
python CarRain/isToDetect.py -c configs/seqTest.yaml
-
获取视频:
python CarRain/seqToVideo.py -c configs/seqTest.yaml
可选择用现有方法获取雨纹图像作为雨层遮罩,也可用此处提供的CRIGNet+RainControlNet生成雨纹图像
-
现有方法:
- weather-particle-simulator:https://github.com/astra-vision/weather-particle-simulator
- 下载RainMask,选择所需分辨率和强度的雨纹图像,将其置于
data/rain
中
-
CRIGNet+RainControlNet:
-
用CRIGNet获取低分辨率雨纹图像:
conda activate hrig
cd CRIGNet&&python gen_rain_mask.py -c ../configs/seqTest.yaml&&cd ..
-
用RainControlNet获取高分辨率雨纹图像:
conda activate control
cd RainControlNet&&python upscale_rain_mask.py -c ../configs/seqTest.yaml&&cd ..
-
- 用HRIGNet获取雨景图像:
conda activate hrig
cd HRIGNet&&python predict_car.py -c ../configs/seqTownsCombineTest.yaml
基于CARLARain,我们构建了一个自动驾驶雨景图像数据集,利用了CARLA提供的8个不同的内置场景,并将时间分别设定为白天、傍晚和夜晚三个时间段,以模拟不同光照环境下的驾驶场景。在车辆和行人仿真方面,在每个场景中随机放置了100个车辆,500个行人。其中,渲染图像的分辨率皆为2048×1024。 该数据集包括8个不同场景,每个场景包括3个时间段,每个时间段包括1000帧的样本,每个样本包括自动驾驶清晰场景RGB图像、语义分割图像、实例分割图像、深度图像、雨纹图像、雨景RGB图像和物体边界框数据。根据场景将该数据集划分为训练集和测试集,训练集包括7个场景,测试集包括1个场景。
数据集可在CARLARain-Dataset获得(提取码:i4zi)
数据集类型 | 场景 | 时间段 | 帧数 | 样本数 | 图像类型 |
---|---|---|---|---|---|
训练集 | 7 | 3 | 1000 | 21000 | 场景RGB图像、语义分割图像、实例分割图像、深度图像、雨纹图像、 雨景RGB图像、物体边界框 |
测试集 | 1 | 3 | 1000 | 3000 |
背景 | 雨景 | 深度估计 | 语义分割 | 实例分割 |
---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
CARLARain 代码在 MIT 许可证下分发。
- CARLA:https://github.com/carla-simulator/carla
- HRIGNet:https://kb824999404.github.io/HRIG/
- CRIGNet:https://doi.org/10.1007/978-981-97-5597-4_8
- ControlNet:https://github.com/lllyasviel/ControlNet
- Rain Rendering:https://github.com/cv-rits/rain-rendering/