This repo is a starlette webapp used to make genre predictions and automatically generate playlists based on an image. It is intended to be used with images from r/fakealbumcovers.
This was originally up on render for a couple of years but is no longer live as it was costing $5 a month to host.
I built this after completing the first part of the fastai course, as a little project to implement some of the stuff I had learnt as part of the course. The starting point for the code was taken from the fastai Render example.
The data to train the models was obtained by running an image of the MusicBrainz server, and using some psql to get album art ids and user submitted genres. The album covers are then obtained with the ids and through the Cover Art Archive API.
A ResNet50 convolutional neural net is used to do image classification, which is then used as a seed genre for Spotify's recommendation API. Along with the genre prediction several other target parameters are passed to the API from another ResNet50 image regression model, that has transfer learnt from a couple hundred examples of different genres to go from album art --> average spotify audio features for the album (danceability, loudness, etc).