Data format
How the dataset is laid out on disk and what each file contains, for reading it without the devkit.
The carlanomaly package reads all of this for you: it loads every modality as a PyTorch dataset, downloads the parts it needs and evaluates detectors at all four tiers.
Install it with pip install git+https://github.com/carlanomaly/devkit; its documentation covers the full API.
The rest of this page is for reading the files directly.
Directory structure
Scenarios are grouped by split and CARLA town (Town01–Town05, Town10HD). In the anomaly test split, scenarios are additionally grouped by anomaly type (e.g. change-weather, vanish-actor).
carlanomaly/train/<town>/scenario-<n>/101 scenarios, 3,000 timesteps eachtest/normal/<town>/scenario-<n>/107 scenarios, 300 timesteps eachanomaly/<town>/<anomaly-type>/scenario-<n>/520 scenarios, 300 timesteps each
Inside a scenario
Every scenario-<n>/ contains the entries below. Files inside a scenario are numbered by timestep: rgb-front/000099.jpg is the front image at timestep 99.
Tags show the download part that ships each entry and the splits it occurs in. Select a part to see what it adds.
scenario-<n>/rgb-front/basetraintestRGB images, JPEG000000.jpg…
rgb-{left,right,rear}/camera-extendedtraintestRGB images of the other cameras000000.jpg…
segmentation-front/basetraintestClass and instance IDs, PNG000000.png…
segmentation-{left,right,rear}/camera-extendedtraintestSegmentation of the other cameras000000.png…
depth-{front,left,right,rear}/depthtraintestLog-encoded depth, PNG000000.png…
pointclouds/lidartraintestSemantic point clouds, feather000000.feather…
kitti-{front,left,right,rear}/kittitraintest3D boxes per cameracalib/label_2/extended/
anomaly-front/basetestPixel masks and sensor labels000000.png…sensor.feather
anomaly-{left,right,rear}/camera-extendedtestLabels for the other cameras000000.png…sensor.feather
anomaly-lidar/lidartestPoint labels and sensor labels000000.feather…sensor.feather
anomaly-observation.featherbasetestTimestep labelsimu.featherbasetraintestAcceleration, angular velocity, headinggnss.featherbasetraintestPositionweather.featherbasetraintestWeather parametersactions.featherbasetraintestAutopilot control commandscollisions.featherbasetraintestCollision events
Cameras



Every pixel carries a semantic class and an instance ID. Since these annotations were generated in a simulation, they are exact.
Segmentation
Segmentation masks are RGBA PNGs named by timestep, e.g. segmentation-front/000099.png. The R channel holds the semantic class ID, the G and B channels the instance ID:
import numpy as np
from PIL import Image
img = np.asarray(Image.open("segmentation-front/000099.png"))
class_ids = img[:, :, 0]
instance_ids = img[:, :, 1].astype(np.int32) | (img[:, :, 2].astype(np.int32) << 8)
Semantic class IDs
| ID | Class |
|---|---|
| 0 | Unlabeled |
| 1 | Road |
| 2 | Sidewalk |
| 3 | Building |
| 4 | Wall |
| 5 | Fence |
| 6 | Pole |
| 7 | Traffic light |
| 8 | Traffic sign |
| 9 | Vegetation |
| 10 | Terrain |
| 11 | Sky |
| 12 | Pedestrian |
| 13 | Rider |
| 14 | Car |
| 15 | Truck |
| 16 | Bus |
| 17 | Train |
| 18 | Motorcycle |
| 19 | Bicycle |
| 20 | Static |
| 21 | Dynamic |
| 22 | Other |
| 23 | Water |
| 24 | Road line |
| 25 | Ground |
| 26 | Bridge |
| 27 | Rail track |
| 28 | Guard rail |
These are CARLA's semantic tags; the LiDAR uses the same IDs.
Depth
Depth maps are 8-bit grayscale PNGs named by timestep, e.g. depth-front/000099.png, in CARLA’s logarithmic encoding. They hold the distance along the camera’s viewing axis and convert to metres as follows:
depth = np.asarray(Image.open("depth-front/000099.png"), dtype=np.float32)
metres = 1000 * np.exp(5.70378 * (depth / 255 - 1))
The encoding covers 3.3 m to 1000 m, and each grey level spans about 2 % of the distance.
Semantic LiDAR
Point clouds for each timestep with per-point semantic class and instance labels. Instance IDs match those in the camera segmentation masks.
Each file loads with pandas:
import pandas as pd
points = pd.read_feather("pointclouds/000000.feather")
| Column | Content |
|---|---|
x, y, z | Position in metres in the sensor frame: x forward, y left, z up |
cos_inc_angle | Cosine of the angle at which the laser ray hits the surface |
object_id | Instance ID, 0 for static map geometry |
object_tag | Semantic class ID (see the class table) |
KITTI annotations
Every camera has a kitti-<camera>/ directory with 3D bounding boxes of the objects in its view, in the KITTI object format: label_2/ holds one label file per timestep and calib/ the camera calibration. extended/ contains the same boxes as feather tables, together with the simulator’s attributes of each object.
Anomaly annotations
Anomaly labels are provided at four levels of granularity, matching the evaluation tiers.
Sample level
For cameras, anomaly-<camera>/ holds one single-channel PNG per timestep, where 0 means normal and any other value means anomaly.
For LiDAR, anomaly-lidar/ holds one feather file per timestep with an anomaly column, one row per point of the matching point cloud.
Sensor level
anomaly-<sensor>/sensor.feather holds one row per timestep with an anomaly column.
Timestep level
A timestep is anomalous when any sensor reading at that point in time contains an anomaly. anomaly-observation.feather holds one row per timestep:
| Column | Content |
|---|---|
anomaly | True or False |
tick | Current timestep number |
anomaly_obj_ids | IDs of objects considered anomalous |
anomaly_class_ids | Class IDs of objects considered anomalous |
meta | Metadata |
Scenario level
Scenario labels are given by the directory: everything under test/anomaly/ is anomalous.
Additional data
Each scenario also contains the following readings, one row per timestep unless noted:
| File | Columns |
|---|---|
imu.feather | acceleration_x/y/z in m/s²; compass heading in radians; angular velocity in rad/s, stored as longitude_x/y/z |
gnss.feather | latitude and longitude in degrees, altitude in metres |
weather.feather | CARLA’s 14 weather parameters, e.g. cloudiness, precipitation and fog_density (0–100), sun_altitude_angle and sun_azimuth_angle in degrees, fog_distance in metres |
actions.feather | frame, throttle and brake (0–1), steer (−1 to 1), hand_brake, reverse, manual_gear_shift, gear: the control command CARLA’s traffic manager applied after the timestep was recorded |
collisions.feather | One row per collision, several per timestep possible: frame, ego_id, ego_type, other_id, other_type, normal_impulse_x/y/z and normal_impulse_norm |
All of them load as pandas dataframes:
import pandas as pd
imu = pd.read_feather("imu.feather")