Upload folder using huggingface_hub
Browse files- .gitattributes +19 -0
- README.md +421 -0
- assets/banner.png +3 -0
- assets/demo_1_embeat_1.mp3 +3 -0
- assets/demo_1_embeat_2.mp3 +3 -0
- assets/demo_1_embeat_3.mp3 +3 -0
- assets/demo_1_seed_track.mp3 +3 -0
- assets/demo_2_embeat_1.mp3 +3 -0
- assets/demo_2_embeat_2.mp3 +3 -0
- assets/demo_2_embeat_3.mp3 +3 -0
- assets/demo_2_seed_track.mp3 +3 -0
- assets/demo_3_embeat_1.mp3 +3 -0
- assets/demo_3_embeat_2.mp3 +3 -0
- assets/demo_3_embeat_3.mp3 +3 -0
- assets/demo_3_seed_track.mp3 +3 -0
- assets/demo_4_embeat_1.mp3 +3 -0
- assets/demo_4_embeat_2.mp3 +3 -0
- assets/demo_4_embeat_3.mp3 +3 -0
- assets/demo_4_seed_track.mp3 +3 -0
- assets/gdmusic_embeat.png +3 -0
- checkpoints/EmbeatMLP/model.pt +3 -0
- checkpoints/Track2Vec/track2vec.wv +3 -0
- checkpoints/Track2Vec/track2vec.wv.vectors.npy +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,22 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
assets/banner.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
assets/demo_1_embeat_1.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
assets/demo_1_embeat_2.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
assets/demo_1_embeat_3.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
assets/demo_1_seed_track.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
assets/demo_2_embeat_1.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
assets/demo_2_embeat_2.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
assets/demo_2_embeat_3.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
assets/demo_2_seed_track.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
assets/demo_3_embeat_1.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
assets/demo_3_embeat_2.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
assets/demo_3_embeat_3.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
assets/demo_3_seed_track.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
assets/demo_4_embeat_1.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
assets/demo_4_embeat_2.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
assets/demo_4_embeat_3.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
assets/demo_4_seed_track.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
assets/gdmusic_embeat.png filter=lfs diff=lfs merge=lfs -text
|
| 54 |
+
checkpoints/Track2Vec/track2vec.wv filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
pipeline_tag: feature-extraction
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
- zh
|
| 8 |
+
datasets:
|
| 9 |
+
- GD-Studio/embeat_45m_spotify_tracks
|
| 10 |
+
tags:
|
| 11 |
+
- music
|
| 12 |
+
- music-recommendation
|
| 13 |
+
- contrastive-learning
|
| 14 |
+
- collaborative-filtering
|
| 15 |
+
- content-based-recommendation
|
| 16 |
+
- spotify
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
<p align="center">
|
| 20 |
+
<img src="assets/banner.png" alt="Embeat Banner" width="100%">
|
| 21 |
+
</p>
|
| 22 |
+
|
| 23 |
+
<p align="center">
|
| 24 |
+
<a href="https://github.com/gdstudio-org/Embeat">Homepage</a> •
|
| 25 |
+
<a href="https://www.bilibili.com/opus/1218087093501165591">Blog</a> •
|
| 26 |
+
<a href="https://huggingface.co/GD-Studio/embeat-track2vec">Model</a> •
|
| 27 |
+
<a href="https://huggingface.co/datasets/GD-Studio/embeat_45m_spotify_tracks">Dataset</a> •
|
| 28 |
+
<a href="https://pan.baidu.com/s/1CWFzgM75Z4YjP1tZnGCZKg?pwd=0616">Database</a>
|
| 29 |
+
</p>
|
| 30 |
+
|
| 31 |
+
<p align="center">
|
| 32 |
+
<a href="https://github.com/gdstudio-org/Embeat"><img src="https://img.shields.io/github/stars/gdstudio-org/Embeat?style=social" alt="Stars"></a>
|
| 33 |
+
<a href="https://github.com/gdstudio-org/Embeat/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-CC--BY--NC%204.0-blue" alt="License"></a>
|
| 34 |
+
</p>
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
# Embeat: A Music Recommendation System Based on Acoustic Features
|
| 39 |
+
|
| 40 |
+
**GitHub project**: [https://github.com/gdstudio-org/Embeat](https://github.com/gdstudio-org/Embeat)
|
| 41 |
+
|
| 42 |
+
## Introduction
|
| 43 |
+
|
| 44 |
+
Embeat is a music recommendation system built on Spotify acoustic feature data. It encodes audio features into vectors via a **contrastive learning model** and combines them with a **multi-channel recall** strategy to deliver high-quality music recommendations.
|
| 45 |
+
|
| 46 |
+
**Key Features:**
|
| 47 |
+
|
| 48 |
+
- **Acoustic Similarity**: The EmbeatMLP model, trained on Spotify Audio Features (key, tempo, energy, valence, etc.), encodes acoustic features into 64-dim vectors
|
| 49 |
+
- **Genre Awareness**: Leverages 6,000+ micro-genre tags to precisely assign genres to 2M+ artists, preventing "acoustically similar but stylistically different" recommendations
|
| 50 |
+
- **Multi-Channel Recall**: 5 parallel recall channels (Acoustic Similarity / Same-Genre Popular / Same Artist / Similar Artists / Playlist Collaborative Filtering), merged and scored for final output
|
| 51 |
+
- **Playlist Collaborative Filtering**: Track2Vec (Word2Vec-inspired) learns track co-occurrence patterns from 1.88M Spotify playlists
|
| 52 |
+
- **Millisecond-Level Response**: Powered by the Qdrant vector database, retrieval across 45M tracks completes in 30–100ms
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
## Roadmap
|
| 56 |
+
|
| 57 |
+
> If you find this project helpful, please give it a ⭐️. It means a lot to a personal project, thanks!
|
| 58 |
+
|
| 59 |
+
- [x] **2026-06-26**: Open-source initial codebase + [EmbeatMLP model weights](checkpoints/EmbeatMLP/)
|
| 60 |
+
- [x] **2026-06-26**: Open-source [45M tracks dataset](https://huggingface.co/datasets/GD-Studio/embeat_45m_spotify_tracks) + [Technical blog](https://www.bilibili.com/opus/1218087093501165591)
|
| 61 |
+
- [x] **2026-07-02**: Open-source Qdrant database V1 [[Google Drive](https://drive.google.com/drive/folders/1dFdueTmcWgGZXhJXs7c7YOjeniZsSW9x?usp=sharing)] [[Baidu Netdisk](https://pan.baidu.com/s/1CWFzgM75Z4YjP1tZnGCZKg?pwd=0616)]
|
| 62 |
+
- [x] **2026-09-06**: Open-source Qdrant database V2 (same link above, 2GB+ RAM can deploy)
|
| 63 |
+
- [x] **2026-09-06**: Open-source [Track2Vec model weights](https://huggingface.co/GD-Studio/embeat-track2vec)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
## Demo
|
| 67 |
+
|
| 68 |
+
> Below are example recommendation results from Embeat (please unmute before playing)
|
| 69 |
+
|
| 70 |
+
<details open>
|
| 71 |
+
<summary><b>Uptown Funk - Bruno Mars [dance pop, pop]</b></summary>
|
| 72 |
+
<table>
|
| 73 |
+
<tr>
|
| 74 |
+
<th width="25%">Seed Track</th>
|
| 75 |
+
<th width="25%">Embeat #1</th>
|
| 76 |
+
<th width="25%">Embeat #2</th>
|
| 77 |
+
<th width="25%">Embeat #3</th>
|
| 78 |
+
</tr>
|
| 79 |
+
<tr>
|
| 80 |
+
<td>Uptown Funk - Bruno Mars</td>
|
| 81 |
+
<td>CAN'T STOP THE FEELING! - Justin Timberlake</td>
|
| 82 |
+
<td>Happy - Pharrell Williams</td>
|
| 83 |
+
<td>I Like to Move It - will.i.am</td>
|
| 84 |
+
</tr>
|
| 85 |
+
<tr>
|
| 86 |
+
<td>
|
| 87 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_1_seed_track.mp3" controls preload="none"></audio>
|
| 88 |
+
</td>
|
| 89 |
+
<td>
|
| 90 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_1_embeat_1.mp3" controls preload="none"></audio>
|
| 91 |
+
</td>
|
| 92 |
+
<td>
|
| 93 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_1_embeat_2.mp3" controls preload="none"></audio>
|
| 94 |
+
</td>
|
| 95 |
+
<td>
|
| 96 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_1_embeat_3.mp3" controls preload="none"></audio>
|
| 97 |
+
</td>
|
| 98 |
+
</tr>
|
| 99 |
+
</table>
|
| 100 |
+
</details>
|
| 101 |
+
|
| 102 |
+
<details>
|
| 103 |
+
<summary><b>杀死那个石家庄人 - 万能青年旅店 [chinese indie rock]</b></summary>
|
| 104 |
+
<table>
|
| 105 |
+
<tr>
|
| 106 |
+
<th width="25%">Seed Track</th>
|
| 107 |
+
<th width="25%">Embeat #1</th>
|
| 108 |
+
<th width="25%">Embeat #2</th>
|
| 109 |
+
<th width="25%">Embeat #3</th>
|
| 110 |
+
</tr>
|
| 111 |
+
<tr>
|
| 112 |
+
<td>杀死那个石家庄人 - 万能青年旅店</td>
|
| 113 |
+
<td>大石碎胸口 - 万能青年旅店</td>
|
| 114 |
+
<td>凄美地 - 郭顶</td>
|
| 115 |
+
<td>不要停止我的音乐 - 痛仰乐队</td>
|
| 116 |
+
</tr>
|
| 117 |
+
<tr>
|
| 118 |
+
<td>
|
| 119 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_2_seed_track.mp3" controls preload="none"></audio>
|
| 120 |
+
</td>
|
| 121 |
+
<td>
|
| 122 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_2_embeat_1.mp3" controls preload="none"></audio>
|
| 123 |
+
</td>
|
| 124 |
+
<td>
|
| 125 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_2_embeat_2.mp3" controls preload="none"></audio>
|
| 126 |
+
</td>
|
| 127 |
+
<td>
|
| 128 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_2_embeat_3.mp3" controls preload="none"></audio>
|
| 129 |
+
</td>
|
| 130 |
+
</tr>
|
| 131 |
+
</table>
|
| 132 |
+
</details>
|
| 133 |
+
|
| 134 |
+
<details>
|
| 135 |
+
<summary><b>Sis puella magica! - 梶浦由記 [anime score, japanese vgm]</b></summary>
|
| 136 |
+
<table>
|
| 137 |
+
<tr>
|
| 138 |
+
<th width="25%">Seed Track</th>
|
| 139 |
+
<th width="25%">Embeat #1</th>
|
| 140 |
+
<th width="25%">Embeat #2</th>
|
| 141 |
+
<th width="25%">Embeat #3</th>
|
| 142 |
+
</tr>
|
| 143 |
+
<tr>
|
| 144 |
+
<td>Sis puella magica! - 梶浦由記</td>
|
| 145 |
+
<td>Decretum - 梶浦由記</td>
|
| 146 |
+
<td>Zoltraak - Evan Call</td>
|
| 147 |
+
<td>Arrietty's Song - Cécile Corbel</td>
|
| 148 |
+
</tr>
|
| 149 |
+
<tr>
|
| 150 |
+
<td>
|
| 151 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_3_seed_track.mp3" controls preload="none"></audio>
|
| 152 |
+
</td>
|
| 153 |
+
<td>
|
| 154 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_3_embeat_1.mp3" controls preload="none"></audio>
|
| 155 |
+
</td>
|
| 156 |
+
<td>
|
| 157 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_3_embeat_2.mp3" controls preload="none"></audio>
|
| 158 |
+
</td>
|
| 159 |
+
<td>
|
| 160 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_3_embeat_3.mp3" controls preload="none"></audio>
|
| 161 |
+
</td>
|
| 162 |
+
</tr>
|
| 163 |
+
</table>
|
| 164 |
+
</details>
|
| 165 |
+
|
| 166 |
+
<details>
|
| 167 |
+
<summary><b>Gizeh - Oskar Schuster [compositional ambient]</b></summary>
|
| 168 |
+
<table>
|
| 169 |
+
<tr>
|
| 170 |
+
<th width="25%">Seed Track</th>
|
| 171 |
+
<th width="25%">Embeat #1</th>
|
| 172 |
+
<th width="25%">Embeat #2</th>
|
| 173 |
+
<th width="25%">Embeat #3</th>
|
| 174 |
+
</tr>
|
| 175 |
+
<tr>
|
| 176 |
+
<td>Gizeh - Oskar Schuster</td>
|
| 177 |
+
<td>Vleurgat - Oskar Schuster</td>
|
| 178 |
+
<td>Sleeping Lotus - Joep Beving</td>
|
| 179 |
+
<td>Travelling - James Spiteri</td>
|
| 180 |
+
</tr>
|
| 181 |
+
<tr>
|
| 182 |
+
<td>
|
| 183 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_4_seed_track.mp3" controls preload="none"></audio>
|
| 184 |
+
</td>
|
| 185 |
+
<td>
|
| 186 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_4_embeat_1.mp3" controls preload="none"></audio>
|
| 187 |
+
</td>
|
| 188 |
+
<td>
|
| 189 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_4_embeat_2.mp3" controls preload="none"></audio>
|
| 190 |
+
</td>
|
| 191 |
+
<td>
|
| 192 |
+
<audio src="https://huggingface.co/GD-Studio/embeat-track2vec/resolve/main/assets/demo_4_embeat_3.mp3" controls preload="none"></audio>
|
| 193 |
+
</td>
|
| 194 |
+
</tr>
|
| 195 |
+
</table>
|
| 196 |
+
</details>
|
| 197 |
+
|
| 198 |
+
### LLM Blind Evaluation
|
| 199 |
+
|
| 200 |
+
Using the LLM-as-a-Judge method (GPT-5.5 / Gemini Flash 3.5 / Claude Sonnet 4.6), Embeat was blindly evaluated against Netease Cloud Music in AB tests:
|
| 201 |
+
|
| 202 |
+
| Judge Model | Embeat Wins | Netease Wins | Tie |
|
| 203 |
+
|-------------|:-----------:|:------------:|:---:|
|
| 204 |
+
| Claude Sonnet 4.6 | **8** | 2 | 0 |
|
| 205 |
+
| Gemini Flash 3.5 | **9** | 1 | 0 |
|
| 206 |
+
| GPT 5.5 | **6** | 4 | 0 |
|
| 207 |
+
|
| 208 |
+
**Conclusions:**
|
| 209 |
+
|
| 210 |
+
- Embeat's core strength lies in its balance between style precision and artist diversity, with a particularly notable advantage in niche-style scenarios that span across languages and cultures
|
| 211 |
+
- Netease Cloud Music retains some reference value only in its deep mining of Mandarin-language local content
|
| 212 |
+
- For detailed comparison, please refer to the [Technical blog](https://www.bilibili.com/opus/1218087093501165591)
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
## System Architecture
|
| 216 |
+
|
| 217 |
+
### Model Details
|
| 218 |
+
|
| 219 |
+
**EmbeatMLP** - Acoustic Feature Encoding Model
|
| 220 |
+
|
| 221 |
+
- Input: 64-dim discrete features (key, mode, tempo, time_signature) + 64-dim continuous features (energy, valence, danceability, etc., 7 dimensions)
|
| 222 |
+
- Architecture: Dual-tower MLP (Discrete Tower + Acoustic Tower -> Backbone)
|
| 223 |
+
- Output: 64-dim L2-normalized vectors
|
| 224 |
+
- Training: Masked InfoNCE Loss, batch_size=4096, converges in ~330 steps
|
| 225 |
+
- Extremely small parameter count, supports real-time CPU-only inference
|
| 226 |
+
|
| 227 |
+
**Track2Vec** - Playlist Collaborative Filtering Model
|
| 228 |
+
|
| 229 |
+
- Based on Word2Vec Skip-Gram, treating playlists as "sentences" and tracks as "words"
|
| 230 |
+
- Training data: 1.88M Spotify playlists
|
| 231 |
+
- Vocabulary: 1.09M tracks, 64-dim vectors
|
| 232 |
+
- Supports real-time CPU-only inference, single query latency < 200ms
|
| 233 |
+
|
| 234 |
+
### Multi-Channel Recall
|
| 235 |
+
|
| 236 |
+
```
|
| 237 |
+
Input seed track: track_id / track_name + artist_name
|
| 238 |
+
│
|
| 239 |
+
├─ Channel 1 [similar]: Acoustic Similarity Recall (genre filtering + EmbeatMLP cosine similarity)
|
| 240 |
+
├─ Channel 2 [popular]: Same-Genre Popular Recall (genre filtering + popularity ranking)
|
| 241 |
+
├─ Channel 3 [same_artist]: Same Artist Recall (same artist + EmbeatMLP cosine similarity)
|
| 242 |
+
├─ Channel 4 [related_artist]: Similar Artists Recall (similar artists + EmbeatMLP cosine similarity)
|
| 243 |
+
├─ Channel 5 [related_track]: Playlist Collaborative Filtering (Track2Vec cosine similarity)
|
| 244 |
+
│
|
| 245 |
+
├─ ISRC Deduplication / Re-ranking / Same-Artist Ratio Control
|
| 246 |
+
│
|
| 247 |
+
└─ Output: Top-K Recommendation List
|
| 248 |
+
```
|
| 249 |
+
|
| 250 |
+
### Project Structure
|
| 251 |
+
|
| 252 |
+
```
|
| 253 |
+
Embeat/
|
| 254 |
+
├── assets/ # Static assets folder
|
| 255 |
+
├── checkpoints/ # Model weights folder
|
| 256 |
+
│ ├── EmbeatMLP/ # EmbeatMLP model weights
|
| 257 |
+
│ └── Track2Vec/ # Track2Vec model weights (requires separate download)
|
| 258 |
+
├── data/ # Data processing folder (not fully organized)
|
| 259 |
+
├── infer/ # Inference code folder
|
| 260 |
+
│ ├── Embeat.py # Embeat recommendation system core
|
| 261 |
+
│ ├── EmbeatUtils.py # Embeat extension utilities
|
| 262 |
+
│ ├── infer.py # EmbeatMLP inference entry point
|
| 263 |
+
│ ├── eval_infer.py # EmbeatMLP evaluation utilities
|
| 264 |
+
│ └── hf_to_qdrant.py # Convert HF Dataset to Qdrant database
|
| 265 |
+
├── train/ # Training code folder
|
| 266 |
+
│ ├── model.py # EmbeatMLP model definition
|
| 267 |
+
│ ├── dataset.py # HF Dataset processing
|
| 268 |
+
│ ├── sampler.py # Positive/negative sample sampler
|
| 269 |
+
│ ├── loss.py # Masked InfoNCE Loss
|
| 270 |
+
│ ├── trainer.py # EmbeatMLP trainer
|
| 271 |
+
│ ├── train.py # EmbeatMLP training entry point
|
| 272 |
+
│ └── train_track2vec.py # Track2Vec training entry point
|
| 273 |
+
├── .env.example # Environment variables example for .env
|
| 274 |
+
├── requirements.txt
|
| 275 |
+
└── LICENSE
|
| 276 |
+
```
|
| 277 |
+
|
| 278 |
+
|
| 279 |
+
## Getting Started
|
| 280 |
+
|
| 281 |
+
### Requirements (recommended)
|
| 282 |
+
|
| 283 |
+
- Python >= 3.10
|
| 284 |
+
- PyTorch >= 2.6, < 2.7 (required for training)
|
| 285 |
+
- CUDA >= 12.0 (required for training)
|
| 286 |
+
- [Qdrant](https://github.com/qdrant/qdrant/releases) >= 1.18 (required for inference)
|
| 287 |
+
|
| 288 |
+
### Installation
|
| 289 |
+
|
| 290 |
+
```bash
|
| 291 |
+
conda create -n embeat python=3.10
|
| 292 |
+
conda activate embeat
|
| 293 |
+
|
| 294 |
+
# Install PyTorch (CUDA 12.x), see https://pytorch.org/get-started/previous-versions/
|
| 295 |
+
pip install "torch>=2.6,<2.7" --index-url https://download.pytorch.org/whl/cu126
|
| 296 |
+
|
| 297 |
+
pip install -r requirements.txt
|
| 298 |
+
```
|
| 299 |
+
|
| 300 |
+
### Train EmbeatMLP
|
| 301 |
+
|
| 302 |
+
```bash
|
| 303 |
+
# 1. Download the HuggingFace tracks dataset to `data/datasets/`, then rename it to `spotify_45m_tracks_metadata`
|
| 304 |
+
# 2. If you want to make more detailed adjustments to the training parameters, please review the code
|
| 305 |
+
cd train
|
| 306 |
+
python train.py
|
| 307 |
+
```
|
| 308 |
+
|
| 309 |
+
### Train Track2Vec
|
| 310 |
+
|
| 311 |
+
```bash
|
| 312 |
+
# 1. Prepare the playlist training data (txt format, one playlist per line, space-separated track_ids)
|
| 313 |
+
# 2. Rename it to `spotify_playlists.txt`, and place it in the `train` folder
|
| 314 |
+
# 3. If you want to make more detailed adjustments to the training parameters, please review the code
|
| 315 |
+
cd train
|
| 316 |
+
python train_track2vec.py
|
| 317 |
+
```
|
| 318 |
+
|
| 319 |
+
### Inference: Compute Acoustic Similarity Between Two Tracks
|
| 320 |
+
|
| 321 |
+
```python
|
| 322 |
+
# 1. Get the acoustic feature data from HuggingFace tracks dataset
|
| 323 |
+
# 2. Or you can find some existed examples from infer/eval_infer.py
|
| 324 |
+
from infer.infer import infer
|
| 325 |
+
|
| 326 |
+
# 晴天 - Jay Chou (G major with fast tempo)
|
| 327 |
+
song_a = {"key": 7, "mode": 1, "tempo": 137, "time_signature": 4,
|
| 328 |
+
"danceability": 0.54, "energy": 0.56, "speechiness": 0.02,
|
| 329 |
+
"instrumentalness": 0.0, "valence": 0.41, "acousticness": 0.23,
|
| 330 |
+
"liveness": 0.1}
|
| 331 |
+
|
| 332 |
+
# 夜曲 - Jay Chou (F minor with slow tempo)
|
| 333 |
+
song_b = {"key": 5, "mode": 0, "tempo": 87, "time_signature": 4,
|
| 334 |
+
"danceability": 0.67, "energy": 0.65, "speechiness": 0.05,
|
| 335 |
+
"instrumentalness": 0.03, "valence": 0.57, "acousticness": 0.27,
|
| 336 |
+
"liveness": 0.19}
|
| 337 |
+
|
| 338 |
+
# Compute acoustic similarity via EmbeatMLP
|
| 339 |
+
similarity = infer(sample_a=song_a, sample_b=song_b,
|
| 340 |
+
checkpoint_path="checkpoints/EmbeatMLP/model.pt")
|
| 341 |
+
|
| 342 |
+
# Similarity: 0.6944
|
| 343 |
+
print(f"Similarity: {similarity:.4f}")
|
| 344 |
+
```
|
| 345 |
+
|
| 346 |
+
### Inference: Qdrant-Based Music Recommendation
|
| 347 |
+
|
| 348 |
+
```bash
|
| 349 |
+
# 1. Start the Qdrant service and import the database
|
| 350 |
+
# 2. Query recommendations for the seed track via command line
|
| 351 |
+
cd infer
|
| 352 |
+
python Embeat.py -t 5pIcwtJYNJx93l420oR2Vm # Query by Spotify Track ID
|
| 353 |
+
python Embeat.py -t TWK970300503 # Query by ISRC
|
| 354 |
+
python Embeat.py -s "晴天 - Jay Chou" # Query by track name and artist
|
| 355 |
+
python Embeat.py -a "Jay Chou" # Query by artist name
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
# Output result for "晴天 - Jay Chou":
|
| 359 |
+
Query track_id: 5pIcwtJYNJx93l420oR2Vm
|
| 360 |
+
Query track info: 晴天 - Jay Chou
|
| 361 |
+
Query artist genres: ['mandopop', 'taiwan pop', 'c-pop', 'zhongguo feng']
|
| 362 |
+
-> Find query record used time: 21ms
|
| 363 |
+
-> Similar recall used time: 48ms
|
| 364 |
+
-> Popular recall used time: 24ms
|
| 365 |
+
-> Same artist recall used time: 4ms
|
| 366 |
+
-> Related artist recall used time: 5ms
|
| 367 |
+
-> Related track recall used time: 123ms
|
| 368 |
+
-> Re-ranking used time: 2ms
|
| 369 |
+
Result artist genres: ['taiwan indie', 'mandopop', 'chinese viral pop', 'cantopop']
|
| 370 |
+
======= Top 20 items =======
|
| 371 |
+
index track_id track_name artist_name album_name sources score
|
| 372 |
+
1 3Qj9Fy8BPbWmICTiNkuqB7 珊瑚海 Jay Chou 11月的蕭邦 ['same_artist', 'related_track'] 1.0
|
| 373 |
+
2 10VuSw48iPN2UK2xX9Y6P0 青花瓷 Jay Chou 我很忙 ['same_artist', 'related_track'] 1.0
|
| 374 |
+
3 0IAgufC1FlOg1nZMmRZxRr 突然好想你 Mayday 後 青春期的詩 ['popular', 'related_artist'] 1.0
|
| 375 |
+
4 2zB7NKVnzRh7xSUSPLErFr 明明就 Jay Chou 十二新作 ['same_artist', 'related_track'] 1.0
|
| 376 |
+
5 5WtMlbTDNZlbN8xZ5zfXva Our Singapore JJ Lin My August 9th - 50 Wonderful Years (2016 Edition) ['similar', 'related_artist'] 1.0
|
| 377 |
+
6 5cU1O9P0EDA0rPkPDykhIm 怎麼了 Eric Chou 終於了解自由 (Deluxe) ['popular', 'related_track'] 1.0
|
| 378 |
+
7 4daA20tBusVX29bUWgd8Dw 交換餘生 JJ Lin 交換餘生 ['popular', 'related_track'] 1.0
|
| 379 |
+
8 1EgGTmmFGtlWuqgXFLrp9x 溫柔 Mayday 愛情萬歲 ['related_artist'] 0.87
|
| 380 |
+
9 3ZuyyfGJqx9qhWTVtdMCWz 生命線 - 電視劇《院長爸爸》片頭曲 Bii 生命線 (電視劇《院長爸爸》片頭曲) ['similar'] 0.85
|
| 381 |
+
10 3p4UTiSIIpP4LFn0KEyEOj 十面埋伏 Eason Chan Live For Today ['related_artist'] 0.85
|
| 382 |
+
11 4lhbajK3dvUcJ0UNEeCdMn 飞鸟和蝉 Ren Ran Ren然 ['related_track'] 0.84
|
| 383 |
+
12 3e8uw7YMiKVcIakItBENqm 天天晴朗(蘇打綠版) sodagreen 秋:故事(蘇打綠版) ['similar'] 0.83
|
| 384 |
+
13 26O8PmJ32hwAbZnIhbJJwZ 天使 Mayday 為愛而生 ['related_artist'] 0.82
|
| 385 |
+
14 3LgoekU3dE5ZMLvuL3NIt9 清醒 (戲劇《淺情人不知》片尾曲) Ariel Tsai 清醒 (戲劇《淺情人不知》片尾曲) ['similar'] 0.81
|
| 386 |
+
15 1WnTw4Tzpc5q9dHMjs4aHu 陰天快樂 Eason Chan rice & shine ['related_artist'] 0.8
|
| 387 |
+
16 14GFYAUxkeXranhS2qrYIZ 我想要佔據你 告五人 帶你飛 ['related_track'] 0.8
|
| 388 |
+
17 1ylx8p71GKQy5g1t4gzuEz 抱歉 Sam Lee 原諒我沒有說 ['similar'] 0.79
|
| 389 |
+
18 7fAdinC2UTc0Y9GiKrkTtu 字字句句 卢卢快闭嘴 字字句句 ['related_track'] 0.78
|
| 390 |
+
19 1VG8o5rUZQZ0wjs7Bi4siU 最熟悉的陌生人 Elva Hsiao 蕭亞軒 (最熟悉的) ['similar'] 0.77
|
| 391 |
+
20 1lM4cYuhJHSsDRfD0ZCRN7 你的背包 Eason Chan 陳奕迅 國語精選 (HQCDII) ['related_artist'] 0.77
|
| 392 |
+
|
| 393 |
+
Query used time: 0.229s
|
| 394 |
+
```
|
| 395 |
+
|
| 396 |
+
|
| 397 |
+
## Related Links
|
| 398 |
+
|
| 399 |
+
<p align="center">
|
| 400 |
+
<img src="assets/gdmusic_embeat.png" alt="GDMusic Embeat" width="100%">
|
| 401 |
+
</p>
|
| 402 |
+
|
| 403 |
+
- GD Music (Live Demo): [https://music.gdstudio.xyz](https://music.gdstudio.xyz)
|
| 404 |
+
- Bilibili: [https://space.bilibili.com/13715770](https://space.bilibili.com/13715770)
|
| 405 |
+
- Telegram: [https://t.me/gdstudio_music](https://t.me/gdstudio_music)
|
| 406 |
+
|
| 407 |
+
|
| 408 |
+
## Acknowledgements
|
| 409 |
+
|
| 410 |
+
- [Anna's Archive](https://annas-archive.org)
|
| 411 |
+
- [Every Noise at Once](https://everynoise.com)
|
| 412 |
+
|
| 413 |
+
|
| 414 |
+
## License
|
| 415 |
+
|
| 416 |
+
| Scope | License |
|
| 417 |
+
|-------|---------|
|
| 418 |
+
| Code, Model Weights | MIT |
|
| 419 |
+
| Datasets, Database | CC-BY-NC 4.0 |
|
| 420 |
+
|
| 421 |
+
> Made with ❤️ by [GD Studio](https://github.com/gdstudio-org)
|
assets/banner.png
ADDED
|
Git LFS Details
|
assets/demo_1_embeat_1.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:968104b3ee8b137cba7b962152d41cb8f2e25cf564d61ffaf6b8da78905e64a8
|
| 3 |
+
size 209010
|
assets/demo_1_embeat_2.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0efeafa2b19ed0f1b12db2e672a9757084a98eccf6257922a521911235811eb6
|
| 3 |
+
size 267667
|
assets/demo_1_embeat_3.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b294bc19445432e5b08a8c3aa0bd8c7b708fd208d53562423e775ef16d423663
|
| 3 |
+
size 156564
|
assets/demo_1_seed_track.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4fb117b9df67e5db31a373c4d88cf564ca7cd092f57c1edd239158953602d0b1
|
| 3 |
+
size 181865
|
assets/demo_2_embeat_1.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74f0daa23c0dae5c158a8a3381baee19a10281a6d9311c7111ddad1df2d9f5b1
|
| 3 |
+
size 388131
|
assets/demo_2_embeat_2.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5797a45e0185558fd780a7dc53c4c3a9a7a0ad2ccb180cbeda6ec51ae2a025a7
|
| 3 |
+
size 268307
|
assets/demo_2_embeat_3.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d8c65452d604f5bc35a317e8cb8a65d2b7811ba3a0c1c775a59a102419f4e24
|
| 3 |
+
size 292819
|
assets/demo_2_seed_track.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d148dbceab1bd299d40afd2c4e65644cbb7111894985242578fc2cdf0eff362a
|
| 3 |
+
size 431077
|
assets/demo_3_embeat_1.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cc0e4eb8d4d874c28d185f2a7b71196de4ab55c1c87eb990eded1c27237ab4b3
|
| 3 |
+
size 411246
|
assets/demo_3_embeat_2.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed0c7cdcd414de25b546eedf8d7a7fa6568e91e1441d9cc8e88860a54a39d64a
|
| 3 |
+
size 306381
|
assets/demo_3_embeat_3.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4e729b69b1ffa471ba50bd9abacfe6822d07c5423a1f280ce176cafed75c6f7
|
| 3 |
+
size 423584
|
assets/demo_3_seed_track.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:70a1bd2836d2f858a690ed61559902df6010a429ade6b84dbfa55cb412ad3d9a
|
| 3 |
+
size 421374
|
assets/demo_4_embeat_1.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8ded0f8b6339c64d26d96c91e375c852e77bd9b673b5858dc3024c26014714fd
|
| 3 |
+
size 367268
|
assets/demo_4_embeat_2.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:14cd6c90958116b7e3035a095db6e5f1d394e5660bec178c9940a99b6d1c8880
|
| 3 |
+
size 450413
|
assets/demo_4_embeat_3.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7bd132523e9706d78773d5ed273eb166b2181bd22492fe60b5c7068d9d652fc0
|
| 3 |
+
size 297219
|
assets/demo_4_seed_track.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ee4c91b1753e291961e6354f2b4b239b4f2872a9de960ace9f595d67052f9746
|
| 3 |
+
size 438111
|
assets/gdmusic_embeat.png
ADDED
|
Git LFS Details
|
checkpoints/EmbeatMLP/model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d284ab6e4f37e08c43fca5dfab792fa1bcc28009485ced09bd23f3e575f3e452
|
| 3 |
+
size 1583444
|
checkpoints/Track2Vec/track2vec.wv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a2359fc57c928d2f7a1c8aaee197d7b3581d6e8dc08c58eb1d02ebc7ebf7f3d6
|
| 3 |
+
size 51277863
|
checkpoints/Track2Vec/track2vec.wv.vectors.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73e1d82738c211bf999c3936b3f0c4cff1a2348f05da85c3cdef836735ed444a
|
| 3 |
+
size 279962496
|