diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml index fc2dcdc..da29646 100644 --- a/.gitea/workflows/docker.yml +++ b/.gitea/workflows/docker.yml @@ -23,41 +23,6 @@ jobs: with: fetch-depth: 0 - - name: Download Essentia models - run: | - mkdir -p backend/models - cd backend/models - - # Download models from Essentia - echo "Downloading Essentia models..." - - # Embedding model (18 MB) - curl -L -o discogs-effnet-bs64-1.pb \ - https://essentia.upf.edu/models/feature-extractors/discogs-effnet/discogs-effnet-bs64-1.pb - - # Genre classifier (2 MB) - curl -L -o genre_discogs400-discogs-effnet-1.pb \ - https://essentia.upf.edu/models/classification-heads/genre_discogs400/genre_discogs400-discogs-effnet-1.pb - - # Genre metadata - curl -L -o genre_discogs400-discogs-effnet-1.json \ - https://essentia.upf.edu/models/classification-heads/genre_discogs400/genre_discogs400-discogs-effnet-1.json - - # Mood classifier (2.7 MB) - curl -L -o mtg_jamendo_moodtheme-discogs-effnet-1.pb \ - https://essentia.upf.edu/models/classification-heads/mtg_jamendo_moodtheme/mtg_jamendo_moodtheme-discogs-effnet-1.pb - - # Instrument classifier (2.6 MB) - curl -L -o mtg_jamendo_instrument-discogs-effnet-1.pb \ - https://essentia.upf.edu/models/classification-heads/mtg_jamendo_instrument/mtg_jamendo_instrument-discogs-effnet-1.pb - - # Genre classifier alternative (2.7 MB) - curl -L -o mtg_jamendo_genre-discogs-effnet-1.pb \ - https://essentia.upf.edu/models/classification-heads/mtg_jamendo_genre/mtg_jamendo_genre-discogs-effnet-1.pb - - ls -lh - echo "Models downloaded successfully!" - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -112,25 +77,6 @@ jobs: with: fetch-depth: 0 - - name: Download Essentia models (for context) - run: | - mkdir -p backend/models - cd backend/models - - # Download models (needed because frontend build context is root) - curl -L -o discogs-effnet-bs64-1.pb \ - https://essentia.upf.edu/models/feature-extractors/discogs-effnet/discogs-effnet-bs64-1.pb - curl -L -o genre_discogs400-discogs-effnet-1.pb \ - https://essentia.upf.edu/models/classification-heads/genre_discogs400/genre_discogs400-discogs-effnet-1.pb - curl -L -o genre_discogs400-discogs-effnet-1.json \ - https://essentia.upf.edu/models/classification-heads/genre_discogs400/genre_discogs400-discogs-effnet-1.json - curl -L -o mtg_jamendo_moodtheme-discogs-effnet-1.pb \ - https://essentia.upf.edu/models/classification-heads/mtg_jamendo_moodtheme/mtg_jamendo_moodtheme-discogs-effnet-1.pb - curl -L -o mtg_jamendo_instrument-discogs-effnet-1.pb \ - https://essentia.upf.edu/models/classification-heads/mtg_jamendo_instrument/mtg_jamendo_instrument-discogs-effnet-1.pb - curl -L -o mtg_jamendo_genre-discogs-effnet-1.pb \ - https://essentia.upf.edu/models/classification-heads/mtg_jamendo_genre/mtg_jamendo_genre-discogs-effnet-1.pb - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.gitignore b/.gitignore index cb37056..2850818 100644 --- a/.gitignore +++ b/.gitignore @@ -75,10 +75,6 @@ yarn-error.log* # Docker postgres_data/ -# Essentia models (large files, download separately) -backend/models/*.pb -backend/models/*.json - # Audio analysis cache *.peaks.json .audio_cache/ diff --git a/backend/models/discogs-effnet-bs64-1.pb b/backend/models/discogs-effnet-bs64-1.pb new file mode 100644 index 0000000..48b1257 Binary files /dev/null and b/backend/models/discogs-effnet-bs64-1.pb differ diff --git a/backend/models/genre_discogs400-discogs-effnet-1.json b/backend/models/genre_discogs400-discogs-effnet-1.json new file mode 100644 index 0000000..938d3ce --- /dev/null +++ b/backend/models/genre_discogs400-discogs-effnet-1.json @@ -0,0 +1,462 @@ +{ + "name": "Genre Discogs400", + "type": "Music genre classification", + "link": "https://essentia.upf.edu/models/classification-heads/genre_discogs400/genre_discogs400-discogs-effnet-1.pb", + "version": "1", + "description": "Prediction of 400 music styles in the from the Discogs taxonomy", + "author": "Pablo Alonso", + "email": "pablo.alonso@upf.edu", + "release_date": "2023-05-04", + "framework": "tensorflow", + "framework_version": "2.8.0", + "classes": [ + "Blues---Boogie Woogie", + "Blues---Chicago Blues", + "Blues---Country Blues", + "Blues---Delta Blues", + "Blues---Electric Blues", + "Blues---Harmonica Blues", + "Blues---Jump Blues", + "Blues---Louisiana Blues", + "Blues---Modern Electric Blues", + "Blues---Piano Blues", + "Blues---Rhythm & Blues", + "Blues---Texas Blues", + "Brass & Military---Brass Band", + "Brass & Military---Marches", + "Brass & Military---Military", + "Children's---Educational", + "Children's---Nursery Rhymes", + "Children's---Story", + "Classical---Baroque", + "Classical---Choral", + "Classical---Classical", + "Classical---Contemporary", + "Classical---Impressionist", + "Classical---Medieval", + "Classical---Modern", + "Classical---Neo-Classical", + "Classical---Neo-Romantic", + "Classical---Opera", + "Classical---Post-Modern", + "Classical---Renaissance", + "Classical---Romantic", + "Electronic---Abstract", + "Electronic---Acid", + "Electronic---Acid House", + "Electronic---Acid Jazz", + "Electronic---Ambient", + "Electronic---Bassline", + "Electronic---Beatdown", + "Electronic---Berlin-School", + "Electronic---Big Beat", + "Electronic---Bleep", + "Electronic---Breakbeat", + "Electronic---Breakcore", + "Electronic---Breaks", + "Electronic---Broken Beat", + "Electronic---Chillwave", + "Electronic---Chiptune", + "Electronic---Dance-pop", + "Electronic---Dark Ambient", + "Electronic---Darkwave", + "Electronic---Deep House", + "Electronic---Deep Techno", + "Electronic---Disco", + "Electronic---Disco Polo", + "Electronic---Donk", + "Electronic---Downtempo", + "Electronic---Drone", + "Electronic---Drum n Bass", + "Electronic---Dub", + "Electronic---Dub Techno", + "Electronic---Dubstep", + "Electronic---Dungeon Synth", + "Electronic---EBM", + "Electronic---Electro", + "Electronic---Electro House", + "Electronic---Electroclash", + "Electronic---Euro House", + "Electronic---Euro-Disco", + "Electronic---Eurobeat", + "Electronic---Eurodance", + "Electronic---Experimental", + "Electronic---Freestyle", + "Electronic---Future Jazz", + "Electronic---Gabber", + "Electronic---Garage House", + "Electronic---Ghetto", + "Electronic---Ghetto House", + "Electronic---Glitch", + "Electronic---Goa Trance", + "Electronic---Grime", + "Electronic---Halftime", + "Electronic---Hands Up", + "Electronic---Happy Hardcore", + "Electronic---Hard House", + "Electronic---Hard Techno", + "Electronic---Hard Trance", + "Electronic---Hardcore", + "Electronic---Hardstyle", + "Electronic---Hi NRG", + "Electronic---Hip Hop", + "Electronic---Hip-House", + "Electronic---House", + "Electronic---IDM", + "Electronic---Illbient", + "Electronic---Industrial", + "Electronic---Italo House", + "Electronic---Italo-Disco", + "Electronic---Italodance", + "Electronic---Jazzdance", + "Electronic---Juke", + "Electronic---Jumpstyle", + "Electronic---Jungle", + "Electronic---Latin", + "Electronic---Leftfield", + "Electronic---Makina", + "Electronic---Minimal", + "Electronic---Minimal Techno", + "Electronic---Modern Classical", + "Electronic---Musique Concr\u00e8te", + "Electronic---Neofolk", + "Electronic---New Age", + "Electronic---New Beat", + "Electronic---New Wave", + "Electronic---Noise", + "Electronic---Nu-Disco", + "Electronic---Power Electronics", + "Electronic---Progressive Breaks", + "Electronic---Progressive House", + "Electronic---Progressive Trance", + "Electronic---Psy-Trance", + "Electronic---Rhythmic Noise", + "Electronic---Schranz", + "Electronic---Sound Collage", + "Electronic---Speed Garage", + "Electronic---Speedcore", + "Electronic---Synth-pop", + "Electronic---Synthwave", + "Electronic---Tech House", + "Electronic---Tech Trance", + "Electronic---Techno", + "Electronic---Trance", + "Electronic---Tribal", + "Electronic---Tribal House", + "Electronic---Trip Hop", + "Electronic---Tropical House", + "Electronic---UK Garage", + "Electronic---Vaporwave", + "Folk, World, & Country---African", + "Folk, World, & Country---Bluegrass", + "Folk, World, & Country---Cajun", + "Folk, World, & Country---Canzone Napoletana", + "Folk, World, & Country---Catalan Music", + "Folk, World, & Country---Celtic", + "Folk, World, & Country---Country", + "Folk, World, & Country---Fado", + "Folk, World, & Country---Flamenco", + "Folk, World, & Country---Folk", + "Folk, World, & Country---Gospel", + "Folk, World, & Country---Highlife", + "Folk, World, & Country---Hillbilly", + "Folk, World, & Country---Hindustani", + "Folk, World, & Country---Honky Tonk", + "Folk, World, & Country---Indian Classical", + "Folk, World, & Country---La\u00efk\u00f3", + "Folk, World, & Country---Nordic", + "Folk, World, & Country---Pacific", + "Folk, World, & Country---Polka", + "Folk, World, & Country---Ra\u00ef", + "Folk, World, & Country---Romani", + "Folk, World, & Country---Soukous", + "Folk, World, & Country---S\u00e9ga", + "Folk, World, & Country---Volksmusik", + "Folk, World, & Country---Zouk", + "Folk, World, & Country---\u00c9ntekhno", + "Funk / Soul---Afrobeat", + "Funk / Soul---Boogie", + "Funk / Soul---Contemporary R&B", + "Funk / Soul---Disco", + "Funk / Soul---Free Funk", + "Funk / Soul---Funk", + "Funk / Soul---Gospel", + "Funk / Soul---Neo Soul", + "Funk / Soul---New Jack Swing", + "Funk / Soul---P.Funk", + "Funk / Soul---Psychedelic", + "Funk / Soul---Rhythm & Blues", + "Funk / Soul---Soul", + "Funk / Soul---Swingbeat", + "Funk / Soul---UK Street Soul", + "Hip Hop---Bass Music", + "Hip Hop---Boom Bap", + "Hip Hop---Bounce", + "Hip Hop---Britcore", + "Hip Hop---Cloud Rap", + "Hip Hop---Conscious", + "Hip Hop---Crunk", + "Hip Hop---Cut-up/DJ", + "Hip Hop---DJ Battle Tool", + "Hip Hop---Electro", + "Hip Hop---G-Funk", + "Hip Hop---Gangsta", + "Hip Hop---Grime", + "Hip Hop---Hardcore Hip-Hop", + "Hip Hop---Horrorcore", + "Hip Hop---Instrumental", + "Hip Hop---Jazzy Hip-Hop", + "Hip Hop---Miami Bass", + "Hip Hop---Pop Rap", + "Hip Hop---Ragga HipHop", + "Hip Hop---RnB/Swing", + "Hip Hop---Screw", + "Hip Hop---Thug Rap", + "Hip Hop---Trap", + "Hip Hop---Trip Hop", + "Hip Hop---Turntablism", + "Jazz---Afro-Cuban Jazz", + "Jazz---Afrobeat", + "Jazz---Avant-garde Jazz", + "Jazz---Big Band", + "Jazz---Bop", + "Jazz---Bossa Nova", + "Jazz---Contemporary Jazz", + "Jazz---Cool Jazz", + "Jazz---Dixieland", + "Jazz---Easy Listening", + "Jazz---Free Improvisation", + "Jazz---Free Jazz", + "Jazz---Fusion", + "Jazz---Gypsy Jazz", + "Jazz---Hard Bop", + "Jazz---Jazz-Funk", + "Jazz---Jazz-Rock", + "Jazz---Latin Jazz", + "Jazz---Modal", + "Jazz---Post Bop", + "Jazz---Ragtime", + "Jazz---Smooth Jazz", + "Jazz---Soul-Jazz", + "Jazz---Space-Age", + "Jazz---Swing", + "Latin---Afro-Cuban", + "Latin---Bai\u00e3o", + "Latin---Batucada", + "Latin---Beguine", + "Latin---Bolero", + "Latin---Boogaloo", + "Latin---Bossanova", + "Latin---Cha-Cha", + "Latin---Charanga", + "Latin---Compas", + "Latin---Cubano", + "Latin---Cumbia", + "Latin---Descarga", + "Latin---Forr\u00f3", + "Latin---Guaguanc\u00f3", + "Latin---Guajira", + "Latin---Guaracha", + "Latin---MPB", + "Latin---Mambo", + "Latin---Mariachi", + "Latin---Merengue", + "Latin---Norte\u00f1o", + "Latin---Nueva Cancion", + "Latin---Pachanga", + "Latin---Porro", + "Latin---Ranchera", + "Latin---Reggaeton", + "Latin---Rumba", + "Latin---Salsa", + "Latin---Samba", + "Latin---Son", + "Latin---Son Montuno", + "Latin---Tango", + "Latin---Tejano", + "Latin---Vallenato", + "Non-Music---Audiobook", + "Non-Music---Comedy", + "Non-Music---Dialogue", + "Non-Music---Education", + "Non-Music---Field Recording", + "Non-Music---Interview", + "Non-Music---Monolog", + "Non-Music---Poetry", + "Non-Music---Political", + "Non-Music---Promotional", + "Non-Music---Radioplay", + "Non-Music---Religious", + "Non-Music---Spoken Word", + "Pop---Ballad", + "Pop---Bollywood", + "Pop---Bubblegum", + "Pop---Chanson", + "Pop---City Pop", + "Pop---Europop", + "Pop---Indie Pop", + "Pop---J-pop", + "Pop---K-pop", + "Pop---Kay\u014dkyoku", + "Pop---Light Music", + "Pop---Music Hall", + "Pop---Novelty", + "Pop---Parody", + "Pop---Schlager", + "Pop---Vocal", + "Reggae---Calypso", + "Reggae---Dancehall", + "Reggae---Dub", + "Reggae---Lovers Rock", + "Reggae---Ragga", + "Reggae---Reggae", + "Reggae---Reggae-Pop", + "Reggae---Rocksteady", + "Reggae---Roots Reggae", + "Reggae---Ska", + "Reggae---Soca", + "Rock---AOR", + "Rock---Acid Rock", + "Rock---Acoustic", + "Rock---Alternative Rock", + "Rock---Arena Rock", + "Rock---Art Rock", + "Rock---Atmospheric Black Metal", + "Rock---Avantgarde", + "Rock---Beat", + "Rock---Black Metal", + "Rock---Blues Rock", + "Rock---Brit Pop", + "Rock---Classic Rock", + "Rock---Coldwave", + "Rock---Country Rock", + "Rock---Crust", + "Rock---Death Metal", + "Rock---Deathcore", + "Rock---Deathrock", + "Rock---Depressive Black Metal", + "Rock---Doo Wop", + "Rock---Doom Metal", + "Rock---Dream Pop", + "Rock---Emo", + "Rock---Ethereal", + "Rock---Experimental", + "Rock---Folk Metal", + "Rock---Folk Rock", + "Rock---Funeral Doom Metal", + "Rock---Funk Metal", + "Rock---Garage Rock", + "Rock---Glam", + "Rock---Goregrind", + "Rock---Goth Rock", + "Rock---Gothic Metal", + "Rock---Grindcore", + "Rock---Grunge", + "Rock---Hard Rock", + "Rock---Hardcore", + "Rock---Heavy Metal", + "Rock---Indie Rock", + "Rock---Industrial", + "Rock---Krautrock", + "Rock---Lo-Fi", + "Rock---Lounge", + "Rock---Math Rock", + "Rock---Melodic Death Metal", + "Rock---Melodic Hardcore", + "Rock---Metalcore", + "Rock---Mod", + "Rock---Neofolk", + "Rock---New Wave", + "Rock---No Wave", + "Rock---Noise", + "Rock---Noisecore", + "Rock---Nu Metal", + "Rock---Oi", + "Rock---Parody", + "Rock---Pop Punk", + "Rock---Pop Rock", + "Rock---Pornogrind", + "Rock---Post Rock", + "Rock---Post-Hardcore", + "Rock---Post-Metal", + "Rock---Post-Punk", + "Rock---Power Metal", + "Rock---Power Pop", + "Rock---Power Violence", + "Rock---Prog Rock", + "Rock---Progressive Metal", + "Rock---Psychedelic Rock", + "Rock---Psychobilly", + "Rock---Pub Rock", + "Rock---Punk", + "Rock---Rock & Roll", + "Rock---Rockabilly", + "Rock---Shoegaze", + "Rock---Ska", + "Rock---Sludge Metal", + "Rock---Soft Rock", + "Rock---Southern Rock", + "Rock---Space Rock", + "Rock---Speed Metal", + "Rock---Stoner Rock", + "Rock---Surf", + "Rock---Symphonic Rock", + "Rock---Technical Death Metal", + "Rock---Thrash", + "Rock---Twist", + "Rock---Viking Metal", + "Rock---Y\u00e9-Y\u00e9", + "Stage & Screen---Musical", + "Stage & Screen---Score", + "Stage & Screen---Soundtrack", + "Stage & Screen---Theme" + ], + "model_types": [ + "frozen_model", + "SavedModel", + "onnx" + ], + "dataset": { + "name": "Discogs-4M (unreleased)", + "citation": "In-house dataset", + "size": "4M full tracks (3.3M used)", + "metrics": { + "ROC-AUC": 0.95417, + "PR-AUC": 0.20629 + } + }, + "schema": { + "inputs": [ + { + "name": "serving_default_model_Placeholder", + "type": "float", + "shape": [ + "batch_size", + 1280 + ] + } + ], + "outputs": [ + { + "name": "PartitionedCall:0", + "type": "float", + "shape": [ + "batch_size", + 400 + ], + "op": "Sigmoid", + "output_purpose": "predictions" + } + ] + }, + "citation": "@inproceedings{alonso2022music,\n title={Music Representation Learning Based on Editorial Metadata from Discogs},\n author={Alonso-Jim{\\'e}nez, Pablo and Serra, Xavier and Bogdanov, Dmitry},\n booktitle={Conference of the International Society for Music Information Retrieval (ISMIR)},\n year={2022}\n}", + "inference": { + "sample_rate": 16000, + "algorithm": "TensorflowPredict2D", + "embedding_model": { + "algorithm": "TensorflowPredictEffnetDiscogs", + "model_name": "discogs-effnet-bs64-1", + "link": "https://essentia.upf.edu/models/music-style-classification/discogs-effnet/discogs-effnet-bs64-1.pb" + } + } +} diff --git a/backend/models/genre_discogs400-discogs-effnet-1.pb b/backend/models/genre_discogs400-discogs-effnet-1.pb new file mode 100644 index 0000000..901c5f8 Binary files /dev/null and b/backend/models/genre_discogs400-discogs-effnet-1.pb differ diff --git a/backend/models/mtg_jamendo_genre-discogs-effnet-1.pb b/backend/models/mtg_jamendo_genre-discogs-effnet-1.pb new file mode 100644 index 0000000..4625f74 Binary files /dev/null and b/backend/models/mtg_jamendo_genre-discogs-effnet-1.pb differ diff --git a/backend/models/mtg_jamendo_instrument-discogs-effnet-1.pb b/backend/models/mtg_jamendo_instrument-discogs-effnet-1.pb new file mode 100644 index 0000000..c5c5529 Binary files /dev/null and b/backend/models/mtg_jamendo_instrument-discogs-effnet-1.pb differ diff --git a/backend/models/mtg_jamendo_moodtheme-discogs-effnet-1.pb b/backend/models/mtg_jamendo_moodtheme-discogs-effnet-1.pb new file mode 100644 index 0000000..b9c8541 Binary files /dev/null and b/backend/models/mtg_jamendo_moodtheme-discogs-effnet-1.pb differ