Notebook for this example can be found: Here
Setting Up the AirGen Car
First, let’s import and initialize the AirGen car simulation:Spawning and Manipulating Objects
Let’s explore how to manipulate objects in the simulation environment:

Adjusting Environmental Conditions
Setting Time of Day
Changing the time of day alters the lighting and shadows in the scene, which is crucial for training models that are robust to different real-world lighting conditionsChanging Object Textures
Randomizing textures helps vision models learn to recognize objects regardless of appearance. By applying different textures, you ensure that the model does not overfit to a single appearance of an object, making it more robust to variations in the real worldSetting Up Computer Vision Models
Now let’s integrate some vision models to test how they perform in our randomized environments:GroundingDINO
is used for object detection, whileCLIPSeg
is used for segmentation.- The
detect
andsegment
functions run the respective models on images captured from the simulation. - By running these models in randomized environments, you can assess their robustness to changes in scene appearance.
Testing Vision Models with Weather Variations
One of the most important aspects of domain randomization is varying weather conditions:
- This loop simulates a range of weather conditions by gradually increasing rain and fog.
- At each step, the detection and segmentation models are evaluated, providing insight into their performance under adverse conditions.
- Such systematic variation is a core part of domain randomization, ensuring the model is not sensitive to specific weather or visibility conditions