{"id":21205892,"url":"https://github.com/gastonduault/music-classifier","last_synced_at":"2026-05-20T03:35:43.254Z","repository":{"id":263426572,"uuid":"890277937","full_name":"gastonduault/Music-Classifier","owner":"gastonduault","description":"This project uses AI for analyzing songs. With the customized and trained model and the website with Flask you can classify music genres.","archived":false,"fork":false,"pushed_at":"2024-11-22T14:41:31.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T15:31:32.740Z","etag":null,"topics":["flask","huggingface","model","music","torch","transformer","wav"],"latest_commit_sha":null,"homepage":"https://huggingface.co/gastonduault/music-classifier","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gastonduault.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-18T09:53:03.000Z","updated_at":"2024-12-27T06:52:44.000Z","dependencies_parsed_at":"2024-11-18T14:32:22.714Z","dependency_job_id":"f6177ef0-4e51-4077-a225-84d4972732b2","html_url":"https://github.com/gastonduault/Music-Classifier","commit_stats":null,"previous_names":["gastonduault/music-classifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gastonduault%2FMusic-Classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gastonduault%2FMusic-Classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gastonduault%2FMusic-Classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gastonduault%2FMusic-Classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gastonduault","download_url":"https://codeload.github.com/gastonduault/Music-Classifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658270,"owners_count":20326467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","huggingface","model","music","torch","transformer","wav"],"created_at":"2024-11-20T20:53:35.044Z","updated_at":"2026-05-20T03:35:43.200Z","avatar_url":"https://github.com/gastonduault.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Music Genre Classification with AI🎶\n\nThe **[music-classifier model](https://huggingface.co/gastonduault/music-classifier)** classifies music genres based on audio signals. It was fine-tuned on the\n**[music_genres_small](https://huggingface.co/datasets/lewtun/music_genres_small)** dataset.\n\nThis project leverages the **[Wav2Vec2](https://huggingface.co/facebook/wav2vec2-large)** model from Facebook, a state-of-the-art transformer-based architecture for audio processing, to classify music genres. The model is fine-tuned on a dataset of music samples to predict the genre of a given audio file.\n\nThe repository includes:\n- Preprocessing of audio data.\n- Flask service for a website for try the model\n- Training scripts for fine-tuning the Wav2Vec2 model.\n- Model evaluation and performance analysis.\n- Deployment of the trained model for real-world predictions.\n---\n## Getting Started\n### Prerequisites\n- Python 3\n- `pip install transformers werkzeug flask torch librosa`\n\n### Run API Flask\n- `Python app.py` (run app.py)\n- website on **[http://localhost:5000](http://localhost:5000)**\n\n---\n## 🖥️ Access the Model\n\n➡️ **[Fine-Tuned Model gastonduault/music-classifier](https://huggingface.co/gastonduault/music-classifier)**\n\n### Metrics\n- **Validation Accuracy**: 75%\n- **F1 Score**: 74%\n- **Validation Loss**: 0.77\n\n---\n\n## 📊 Dataset\nThe dataset used for training is `lewtun/music_genres_small` from Hugging Face's datasets library. It contains diverse audio tracks labeled with genres.\n\n**Classes:**\n- `Electronic`\n- `Rock`\n- `Punk`\n- `Experimental`\n- `Hip-Hop`\n- `Folk`\n- `Chiptune / Glitch`\n- `Instrumental`\n- `Pop`\n- `International`\n\n---\n\n## 📂 Repository Structure\n- **`training.py`**: Script for training and evaluating the Wav2Vec2 model ***(with Google colab)***.\n- **`prediction.py`**: Script to make predictions on new audio files using the trained model.\n- **`app.py`**: Python API with Flask framework for testing the model.\n\n---\n## The interface of testing\n![img.png](static/img.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgastonduault%2Fmusic-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgastonduault%2Fmusic-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgastonduault%2Fmusic-classifier/lists"}