musicnn-pytorch / inference.py
debuglevel's picture
Duplicate from oriyonay/musicnn-pytorch
0bbc70a
raw
history blame contribute delete
663 Bytes
from musicnn_torch import top_tags
import os
# Use the absolute paths you provided
files = [
'/Users/oriyonay/Desktop/CRAZY BEAT.mp3',
'/Users/oriyonay/Desktop/burn the stage/bounces/02 the type of girl.mp3',
'/Users/oriyonay/Desktop/burn the stage/extras/jazzy red roses.mp3'
]
for f in files:
if os.path.exists(f):
print(f"\n--- Predicting top tags for {os.path.basename(f)} ---")
try:
tags = top_tags(f, model='MTT_musicnn', topN=5)
print(f"Top 5 tags: {tags}")
except Exception as e:
print(f"Error processing {f}: {e}")
else:
print(f"\nWarning: File not found at {f}")