How jgaldeano96/tfm-pedestrian-traffic-light works
This repository supports a traffic-light video analysis demo and the research workflow behind its models: preparing annotated data, training YOLO and classifier models, and evaluating them under day/night conditions. In the demo, a user selects video and inference options; the app loads configured models, processes the video frame by frame, and presents a downloadable annotated result with timing and summary metrics. Dataset and training relationships beyond the shown calls are represented conservatively: some scripts are listed in the source index but their implementation was not excerpted.
Main entry points: app.py Streamlit app · datasets Train and test datasets · video_processing.py Video processing · dataset Dataset workflows
Components 18
Video demo
- Streamlit app
app.py - Annotated MP4
Inference runtime
- Model configuration
tfm_demo/config.py - Model loading
tfm_demo/model_loading.py - Video processing
tfm_demo/video_processing.py - Detection and classification
tfm_demo/inference.py
Dataset preparation
- Label Studio exports
data/annotation_exports - Video preprocessing
scripts/preprocessing - Dataset generation
scripts/utils/dataset_functions.py - Dataset workflows
scripts/dataset - Train and test datasets
data/datasets
Training and evaluation
- YOLO training
scripts/training/yolo26_training.py - Classifier training
scripts/training/CNN_training.py - Trained model files
models - Test evaluation
scripts/test - Evaluation results
results
Other components
- Demo user
- Input video
Connections 20
- Demo user → Streamlit app: uses
app.py - Demo user → Input video: selects
- Streamlit app → Model configuration: gets model settings
app.py - Streamlit app → Model loading: loads models
app.py - Streamlit app → Video processing: processes video
app.py - Input video → Video processing: provides frames
tfm_demo/video_processing.py - Video processing → Detection and classification: runs inference
tfm_demo/video_processing.py - Model loading → Detection and classification: provides model sessions
tfm_demo/inference.py - Video processing → Annotated MP4: encodes output
tfm_demo/video_processing.py - Streamlit app → Annotated MP4: offers download
app.py - Label Studio exports → Dataset generation: supplies labels
- Dataset workflows → Dataset generation: calls helpers
scripts/dataset/create_classifier_dataset.py - Dataset workflows → Train and test datasets: writes datasets
- Video preprocessing → Train and test datasets: prepares frames
- Train and test datasets → YOLO training: training input
- Train and test datasets → Classifier training: training input
- YOLO training → Trained model files: saves weights
- Classifier training → Trained model files: exports classifier
- Train and test datasets → Test evaluation: test input
- Test evaluation → Evaluation results: writes metrics