Views
No views yet
valence, energy,
danceability, acousticness, tempo. The top-3 detected moods are
blended (weighted by CLIP's confidence) into one target vector.NearestNeighbors search (scikit-learn) over a
Spotify tracks dataset finds the songs whose audio features are closest
to that target vector.pipeline.py — full pipeline: image in, ranked song recommendations outrequirements.txt — dependencies1from pipeline import recommend_songs
2from PIL import Image
3
4image = Image.open("your_photo.jpg")
5mood_breakdown, songs = recommend_songs(image, n_songs=5)
6
7for mood, weight in mood_breakdown:
8 print(f"{mood}: {weight:.2f}")
9
10for song in songs:
11 print(song["track_name"], "-", song["artist"])pipeline.py expects a spotify_dataset.csv file in the same
directory (not included in this repo — see Dataset section below) with
columns: track_name, artists, valence, energy, danceability,
acousticness, tempo, and optionally track_genre.spotify_dataset.csv alongside pipeline.py.