How hoang-phuong-nguyen/woodscape works
Project Type and Purpose
• This is an open‐source machine‐learning toolkit (named OmniDet) built on top of the WoodScape fisheye dataset for autonomous‐driving perception. It provides data‐preprocessing scripts, a multi‐task surround‐view neural network (backbone + multiple decoders), training entry points, loss definitions, evaluation routines, and ONNX export/verification.
High‐Level File Structure Analysis
• Top‐level
– data/ ← local placeholder for downloaded WoodScape dataset
– omnidet/ ← core Python package
– scripts/ ← data‐generation, calibration, config, parser utilities
• omnidet/ sub‐packages
– data/ ← precomputed lookup tables, generation scripts
– data_loader/ ← dataset classes (WoodScape loader)
– models/ ← backbone (ResNet, PoseNet), decoders (detection, semantic, distance, motion, normnet), ONNX export
– losses/ ← per‐task and multi‐task loss functions
– train_utils/ ← helper routines (anchor generation, weighting, pose utils)
– eval/ ← quantitative & qualitative evaluation scripts
– main.py ← CLI entry point for training/inference
– train_*.py ← task‐specific training orchestrators
– utils.py ← general utilities
• scripts/
– annotation generators (semantic_map_generator.py, box_2d_generator.py, polygon_generator.py)
– calibration tools
– config JSONs for mapping classes
Key ARCHITECTURAL PATTERNS
• Layered architecture:
Data Layer → Preprocessing Layer (scripts) → DataLoader → Model Layer → Loss Layer → Training Loop → Inference/Export → Evaluation
• Modular separation by concern: data ingestion, model definition, loss computation, training orchestration, evaluation, data‐prep scripts.
Main Components & Interactions (
• WoodScape raw images & annotations (data/ or external Google Drive)
• Precomputed LUTs, params.yaml (omnidet/data)
B. Data Preprocessing Scripts (Rectangles, light blue)
• semantic_map_generator.py
• box_2d_generator.py
• polygon_generator.py
• calibration scripts
C. Data Loader (Rectangle, green)
• omnidet/data_loader/woodscape_loader.py
––> reads images + processed labels
D. Model (Rectangle, dark green)
• Backbone: ResNet, PoseNet
• Decoders: detection_decoder, semantic_decoder, distance_decoder, motion_decoder, normnet_decoder
• ONNX export/verify (models/onnx)
E. Loss Functions (Rectangle, orange)
• detection_loss, semantic_loss, distance_loss, motion_loss, mtl_losses
F. Training Orchestration (Rectangle, yellow)
• omnidet/main.py (common CLI)
• train_*.py for single/multi‐task setups
––> orchestrates DataLoader → Model → Loss → Optimizer → Backprop
G. Evaluation (Rectangle, red)
• omnidet/eval/*.py (quantitative & qualitative routines)
H. Utilities & Config (Parallelograms, grey)
• train_utils, utils.py, scripts/configs JSONs
• Python packages from requirements.txt (numpy, OpenCV, PyTorch, shapely, Pillow, matplotlib)
• Google Drive dataset/annotations
1. External dataset (Cloud)
→ raw data folder (data/)
2. Data folder
→ Data Preprocessing Scripts
→ processed annotations
3. Processed annotations + images
→ Data Loader
4. Data Loader
→ Training Orchestrator
5. Training Orchestrator
→ Model forward pass
→ Loss functions
→ Optimizer updates
→ (loop)
-–> after convergence
→ ONNX Export
6. Model or ONNX model
→ Evaluation scripts
→ Metrics & visualizations