Architecture Changes¶
Navigation
TOC is limited to main sections for better readability. Use Ctrl+F to search for specific changes.
| Change | Date | Impact | Breaking | Status |
|---|---|---|---|---|
| Object Detection Model Upgrade | Aug 2025 | Low | ❌ No | ✅ Complete |
| Version Management Centralization | Aug 2025 | Low | ✅ Yes | ✅ Complete |
| MARL Extension Separation | Aug 2025 | Low | ❌ No | ✅ Complete |
| Documentation Reorganization | Aug 2025 | Low | ❌ No | ✅ Complete |
Object Detection Architecture¶
What Changed: Upgraded from YOLOv5 to YOLOv8 with improved threading and compatibility
# opencda/customize/ml_libs/ml_manager.py
def __init__(self):
try:
# Prefer YOLOv8 (ultralytics package)
from ultralytics import YOLO
self.object_detector = YOLO('yolov8m.pt')
self.use_v8 = True
except ImportError:
# Fallback to YOLOv5 (torch hub)
self.object_detector = torch.hub.load('ultralytics/yolov5', 'yolov5m')
self.use_v8 = False
# Automatic conversion for camera-lidar fusion
if self.use_v8:
# YOLOv8 format: separate arrays (xyxy, conf, cls)
xyxy = boxes.xyxy.cpu()
conf = boxes.conf.cpu().unsqueeze(1)
cls = boxes.cls.cpu().unsqueeze(1)
# Convert to YOLOv5 format: [x1, y1, x2, y2, confidence, class_id]
yolo_v5_format = torch.cat([xyxy, conf, cls], dim=1)
Impact: None - fully backward compatible
Benefits: Better performance, improved accuracy, thread safety, modern dependency management
Version Management System¶
What Changed: Removed opencda/version.py, centralized version info in opencda/__init__.py
Impact: All code importing version information needs updating
Benefits: Simplified version management, single source of truth
Module Organization¶
What Changed: Created separate opencda_marl/ directory for MARL components
Impact: No impact on existing OpenCDA code
Benefits: Clear separation, parallel development, optional MARL integration
Documentation Organization¶
What Changed: Structured docs to separate OpenCDA core from MARL extension
| Component | Location | Purpose |
|---|---|---|
| OpenCDA Core | docs/opencda/ |
Original OpenCDA documentation |
| MARL Extension | docs/marl/ |
MARL-specific guides and API |
| API Reference | docs/api/ |
Combined API documentation |
Impact: Documentation moved to new locations
Benefits: Clear separation, easier maintenance, parallel development