How mrgi23/music-genres-classification works
Music Genres Classification is a dual-language audio classification system for GTZAN-style music data. Its main workflow prepares audio features and dataset splits, then trains or loads a CNN and predicts genres or evaluates performance. The Python and C++ implementations share these domain stages; the C++ executable and Python command-line wrapper provide separate orchestration paths. The README also describes automatic spectrogram/MFCC feature extraction and the ten-class task. Some implementation links rely on the SOURCE INDEX; unsampled relationships are omitted.
Main entry points: utils_py.py Python workflow · trainer.cpp Train and evaluate · utils.hpp C++ workflow · main.cpp C++ CLI
Components 17
Application entrypoints
- C++ CLI
app/main.cpp - C++ workflow
app/utils.hpp - Python CLI
app/musicnet_py.py - Python workflow
app/utils_py.py
Python runtime
- Dataset download
src/python/downloader.py - Audio features
src/python/preprocessor.py - Audio dataset
src/python/dataset.py - CNN model
src/python/model.py
C++ runtime
- Dataset download
src/cpp/downloader.cpp - Audio features
src/cpp/preprocessor.cpp - Audio dataset
src/cpp/dataset.cpp - CNN model
src/cpp/model.cpp
Training components
- Train and evaluate
src/python/trainer.py - Optimizer factory
inc/optimizer.hpp - Learning scheduler
src/cpp/scheduler.cpp - Train and evaluate
src/cpp/trainer.cpp
Other components
- Operator
Connections 18
- Operator → C++ CLI: runs
app/main.cpp - C++ CLI → C++ workflow: dispatches
app/main.cpp - Operator → Python CLI: runs
app/musicnet_py.py - Python CLI → Python workflow: delegates to
app/musicnet_py.py - Python workflow → Dataset download: uses
app/utils_py.py - Python workflow → Audio features: uses
app/utils_py.py - Python workflow → Audio dataset: uses
app/utils_py.py - Python workflow → CNN model: uses
app/utils_py.py - Python workflow → Train and evaluate: uses
app/utils_py.py - Audio dataset → Audio features: extracts features with
src/python/dataset.py - Train and evaluate → CNN model: trains and evaluates
src/python/trainer.py - C++ workflow → Dataset download: uses
app/utils.hpp - C++ workflow → Train and evaluate: uses
app/utils.hpp - Audio dataset → Audio features: extracts features with
- Train and evaluate → Audio dataset: reads batches from
- Train and evaluate → CNN model: trains and evaluates
- Train and evaluate → Optimizer factory: creates optimizer
- Train and evaluate → Learning scheduler: attaches scheduler