This project focuses on classifying music tracks into various genres using machine learning techniques. By analyzing audio features, the model predicts the genre of a given music track, aiding in music organization and recommendation systems.
- Accurately classifies music tracks into predefined genres.
- Utilizes a trained neural network model (
Trained_Model.h5
). - Includes scripts for training (
genre_classifier.ipynb
) and testing (test_genre.ipynb
).
-
Clone the repository:
git clone https://github.com/ronnie-allen/Music_Genre_Model.git cd Music_Genre_Model
-
Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
Note: Ensure that the
requirements.txt
file lists all necessary packages.
-
Training the Model:
- Use the
genre_classifier.ipynb
notebook to train the model on your dataset. - Ensure the dataset is placed in the
Music_Genre_Dataset
directory.
- Use the
-
Testing the Model:
- Use the
test_genre.ipynb
notebook to test the model's performance on new data. - Place your test audio files in the
Music_Testing
directory.
- Use the
-
Predicting Genre for a New Track:
-
Run the
Music_genre.py
script with the path to your audio file:python Music_genre.py --file_path path_to_your_audio_file
-
The project uses a dataset of music tracks categorized by genre. Ensure that your dataset is organized appropriately within the Music_Genre_Dataset
directory for training purposes.
The trained model is saved as Trained_Model.h5
. You can load this model for predictions or retrain it using the provided training scripts.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with detailed changes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Librosa for audio processing.
- Keras for building the neural network.
- GTZAN Music Genre Dataset for providing the dataset.
For any issues or feedback, feel free to open an issue on this repository or contact me directly.
Happy coding! 🎶