mrob937 commited on
Commit
5640f2c
Β·
verified Β·
1 Parent(s): c02a880

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +27 -6
  2. app.py +25 -0
  3. requirements.txt +5 -0
README.md CHANGED
@@ -1,12 +1,33 @@
1
  ---
2
- title: Music Recommender
3
- emoji: 🐒
4
- colorFrom: indigo
5
- colorTo: green
6
  sdk: gradio
7
- sdk_version: 5.49.0
8
  app_file: app.py
9
  pinned: false
 
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: AI Music Recommender
3
+ emoji: 🎡
4
+ colorFrom: purple
5
+ colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 4.44.0
8
  app_file: app.py
9
  pinned: false
10
+ license: mit
11
  ---
12
 
13
+ # 🎡 AI Music Recommendation System
14
+
15
+ An intelligent music recommendation system that combines CNN-based playlist classification with cosine similarity search.
16
+
17
+ ## πŸš€ Features
18
+
19
+ - **Smart Playlist Prediction**: Uses a trained CNN to predict the top 2 most likely playlists for any song
20
+ - **Efficient Search**: Reduces search space by only looking within predicted playlists
21
+ - **Audio Feature Analysis**: Powered by MERT (Music Understanding Model) embeddings
22
+ - **Real-time Recommendations**: Get instant song suggestions based on audio similarity
23
+
24
+ ## 🎯 Technical Stack
25
+
26
+ - **Model**: Custom 1D CNN for playlist classification
27
+ - **Features**: MERT audio embeddings
28
+ - **Similarity**: Cosine similarity on L2-normalized feature vectors
29
+ - **Search**: K-Nearest Neighbors (KNN) with reduced search space
30
+
31
+ ## πŸŽ“ Academic Project
32
+
33
+ This is a class project demonstrating the application of deep learning to music information retrieval (MIR).
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import gradio as gr
3
+ from huggingface_hub import hf_hub_download
4
+ import os
5
+
6
+ # Download model and cache on startup
7
+ if not os.path.exists("best_model.pth"):
8
+ print("πŸ“₯ Downloading model...")
9
+ hf_hub_download(
10
+ repo_id="YOUR_USERNAME/music-recommender-assets",
11
+ filename="best_model.pth",
12
+ local_dir=".",
13
+ repo_type="model"
14
+ )
15
+
16
+ if not os.path.exists("features_cache.h5"):
17
+ print("πŸ“₯ Downloading features...")
18
+ hf_hub_download(
19
+ repo_id="YOUR_USERNAME/music-recommender-assets",
20
+ filename="features_cache.h5",
21
+ local_dir=".",
22
+ repo_type="model"
23
+ )
24
+
25
+ # ... rest of your app.py code ...
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ gradio
2
+ torch
3
+ numpy
4
+ scikit-learn
5
+ h5py