CoolFace
Modelpublic

AutowareFoundation/traffic_light_fine_detector

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes85downloads
Model Card

YOLOX-s Traffic Light Fine Detector for Autoware (traffic_light_fine_detector)

Camera-based traffic light detection models, used by the `autoware_traffic_light_fine_detector` node in Autoware.

The models are YOLOX-s [1] detectors fine-tuned by TIER IV for traffic light detection. Given the full camera image and the coarse ROIs predicted by the traffic_light_map_based_detector node, the fine detector refines each ROI to a tight bounding box around the traffic light. The models are exported as ONNX; Autoware builds the TensorRT engine from the ONNX file on first launch.

Model overview

Task2D traffic light detection (ROI refinement) in camera images
ArchitectureYOLOX-s
Detected classestraffic_light, pedestrian_traffic_light (plus a BACKGROUND label)
RuntimeTensorRT (FP16 by default, FP32 selectable) via the autoware_traffic_light_fine_detector ROS 2 node
FormatONNX (Autoware builds the TensorRT engine locally on first launch)
LicenseApache-2.0

Variants in this repository

The three ONNX files share the same weights and differ only in their static batch size. The TensorRT engine requires a fixed batch size, so the node pads the ROI list with dummy entries up to the model's batch size when fewer traffic lights are visible.

VariantBatch sizeDefault in Autoware
tlr_car_ped_yolox_s_batch_1.onnx1
tlr_car_ped_yolox_s_batch_4.onnx4
tlr_car_ped_yolox_s_batch_6.onnx6yes (loaded by the package's launch file)

Files

FileDescription
tlr_car_ped_yolox_s_batch_1.onnxYOLOX-s traffic light detector, static batch size 1
tlr_car_ped_yolox_s_batch_4.onnxYOLOX-s traffic light detector, static batch size 4
tlr_car_ped_yolox_s_batch_6.onnxYOLOX-s traffic light detector, static batch size 6 (default)
tlr_labels.txtClass labels: BACKGROUND, traffic_light, pedestrian_traffic_light
deploy_metadata.yamlDeployment metadata recording the artifact version of this repository
TensorRT engines are not distributed here. TensorRT engines are specific to the GPU architecture and TensorRT version they are built on and are not portable, so Autoware builds them locally from the ONNX files on first launch (or via build_only:=true).

Inputs and outputs (as used by the node)

Inputs

TopicTypeDescription
~/input/imagesensor_msgs/msg/ImageThe full size camera image
~/input/roistier4_perception_msgs/msg/TrafficLightRoiArrayCoarse ROIs from the map-based detector
~/expect/roistier4_perception_msgs/msg/TrafficLightRoiArrayOffset-free ROIs used to select the best detections

Outputs

TopicTypeDescription
~/output/roistier4_perception_msgs/msg/TrafficLightRoiArrayThe refined, accurate ROIs
~/debug/exe_time_msautoware_internal_debug_msgs/msg/Float32StampedInference time

If no traffic light is detected inside a coarse ROI, the output ROI's x_offset, y_offset, height, and width are set to 0. Detections from YOLOX are matched against the expect/rois array as a whole set, not each ROI in isolation. Key node parameters (defaults): precision: fp16, score_thresh: 0.3, nms_thresh: 0.65, gpu_id: 0.

Usage in Autoware

The node expects these artifacts under ~/autoware_data/ml_models/traffic_light_fine_detector/ and launches with, e.g.:

bash
ros2 launch autoware_traffic_light_fine_detector traffic_light_fine_detector.launch.xml \
  data_path:=$HOME/autoware_data/ml_models \
  model_path:=$HOME/autoware_data/ml_models/traffic_light_fine_detector/tlr_car_ped_yolox_s_batch_6.onnx \
  label_path:=$HOME/autoware_data/ml_models/traffic_light_fine_detector/tlr_labels.txt

Add build_only:=true to build the TensorRT engine from the ONNX as a one-off pre-task. See the package README for the full parameter reference.

Training

  • Base model: YOLOX-s from the official YOLOX repository, starting from the published yolox_s.pth pretrained weights.
  • Fine-tuning: performed by TIER IV on around 17,000 internal images of Japanese traffic lights.
  • Further training details (epochs, hyperparameters, evaluation metrics) are not publicly documented.

Limitations

  • Fine-tuned on Japanese traffic lights; accuracy on traffic lights with different shapes, layouts, or signaling conventions may drop without additional fine-tuning.
  • The node is designed to run downstream of the map-based detector: it refines externally provided ROIs rather than detecting traffic lights anywhere in the frame.
  • The TensorRT engine has a static batch size; scenes with more simultaneous ROIs than the model's batch size are processed in multiple inference passes.

Provenance

Original sourcehttps://awf.ml.dev.web.auto/perception/models/tlr_yolox_s/v3/
Version tag in this repositoryv3.0

Citation

bibtex
@article{ge2021yolox,
  title   = {YOLOX: Exceeding YOLO Series in 2021},
  author  = {Ge, Zheng and Liu, Songtao and Wang, Feng and Li, Zeming and Sun, Jian},
  journal = {arXiv preprint arXiv:2107.08430},
  year    = {2021}
}

References

  • [1] Ge et al., "YOLOX: Exceeding YOLO Series in 2021", arXiv:2107.08430, 2021.
  • YOLOX repository: <https://github.com/Megvii-BaseDetection/YOLOX>