MLflow is the experiment tracking framework for the project.
It records:
- Experiment configurations
- Parameters
- Metrics
- Artifacts
- Trained models
- Experiment history
Think of MLflow as your digital research notebook.
Write Code
│
▼
Run Experiment
│
▼
MLflow Logs Everything
│
▼
Compare Results
│
▼
Improve Model
│
▼
Repeat
Run the MLflow UI from the project root.
mlflow uiOpen:
http://127.0.0.1:5000
Leave it running while performing experiments.
from utils.mlflow_logger import MLFlowLoggerlogger = MLFlowLogger()Only one logger is required per experiment.
Every meaningful experiment should have its own run.
logger.start_run("Detection Benchmark")- Detection Benchmark
- Depth Benchmark
- Segmentation Benchmark
- Tracking Benchmark
- Pose Benchmark
- Metric Scene Graph
- Temporal Scene Graph
- Navigation Benchmark
- World Model
- Ablation - Without Depth
- Ablation - Without Pose
- Ablation - Without Temporal
- Final Pipeline
Parameters describe how the experiment was executed.
Log them immediately after starting the run.
logger.log_params({
"Detector": "YOLO-World",
"Depth": "Depth Pro",
"Segmentation": "SAM2",
"Tracker": "ByteTrack",
"Pose": "RTMPose",
"Resolution": 640,
"Device": "RTX4060",
"Precision": "FP16"
})- Detector
- Depth Model
- Segmentation Model
- Tracker
- Pose Model
- Resolution
- Batch Size
- Confidence Threshold
- Device
- Precision
- Dataset
- Frame Skip
- Temporal Window
Run the pipeline normally.
Example:
objects = detector.detect(frame)
tracks = tracker.track(objects)
scene = scene_builder.build(frame, tracks)
world_state = world_model.update(scene)Important
Do NOT use MLflow inside:
- detector.py
- tracker.py
- depth_estimator.py
- segmentor.py
- scene_graph.py
- world_model.py
These modules should only perform inference.
Evaluation modules compute the metrics.
Example:
metrics = {
"FPS": 32.4,
"Latency": 24.6,
"Objects": 8,
"Scene Graph Precision": 0.91,
"Temporal Stability": 0.94
}logger.log_metrics(metrics)or
logger.log_metric("FPS", fps)
logger.log_metric("Latency", latency)Artifacts are files generated during the experiment.
Examples:
- Images
- Videos
- JSON files
- CSV files
- Confusion Matrices
- BEV Maps
- Graph Visualizations
- Plots
Example:
logger.log_artifact("outputs/output.mp4")
logger.log_artifact("outputs/scene_graph.json")
logger.log_artifact("outputs/bev.png")
logger.log_artifact("paper/plots/fps_curve.png")Only required when training a model.
logger.log_pytorch_model(model)Examples:
- ST-GCN
- Scene Graph GNN
- Future Predictor
- Fine-tuned Models
logger.end_run()Always end every experiment with end_run().
from utils.mlflow_logger import MLFlowLogger
logger = MLFlowLogger()
logger.start_run("Detection Benchmark")
logger.log_params({
"Detector": "YOLO-World",
"Resolution": 640,
"Device": "RTX4060"
})
# Run experiment
fps = 32.6
latency = 21.4
logger.log_metrics({
"FPS": fps,
"Latency": latency
})
logger.log_artifact("outputs/output.mp4")
logger.end_run()Experiment Script
│
▼
Start Run
│
▼
Log Parameters
│
▼
Run Pipeline
│
▼
Compute Metrics
│
▼
Log Metrics
│
▼
Log Artifacts
│
▼
End Run
Use MLflow for:
- Benchmarking
- Ablation studies
- Model comparison
- Hyperparameter tuning
- Final evaluation
- Paper experiments
Do NOT use MLflow for:
- Unit tests
- Debugging
- Individual model implementations
CortexVision/
configs/
mlflow.yaml
utils/
mlflow_logger.py
experiments/
01_detection/
02_depth/
03_scene_graph/
04_world_model/
08_ablations/
evaluation/
outputs/
artifacts/
mlflow.db
✅ One run = One experiment
✅ Log parameters immediately after starting the run
✅ Log metrics after evaluation
✅ Log generated artifacts
✅ Use descriptive run names
✅ Compare runs through the MLflow UI
❌ Don't call MLflow inside model modules
❌ Don't create a new run for every debugging attempt
❌ Don't mix multiple experiments into one run