jsd219 commited on
Commit
c869916
·
verified ·
1 Parent(s): 3195410

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -19,13 +19,13 @@ def estimate_genre(filepath):
19
  return {"Error": f"Feature extraction failed: {str(e)}"}
20
 
21
  # Heuristic genre rules
22
- if tempo > 140 and brightness > 2500:
23
  genre = "Electronic / Dance"
24
  elif tempo < 90 and chroma_strength < 0.3:
25
  genre = "Hip Hop / Trap"
26
- elif 100 < tempo < 130 and brightness > 2300 and chroma_strength > 0.7:
27
  genre = "Pop / Rock"
28
- elif brightness < 1800 and chroma_strength > 0.9:
29
  genre = "Jazz / Soul"
30
  else:
31
  genre = "Unknown"
 
19
  return {"Error": f"Feature extraction failed: {str(e)}"}
20
 
21
  # Heuristic genre rules
22
+ if tempo > 140 and centroid > 2500:
23
  genre = "Electronic / Dance"
24
  elif tempo < 90 and chroma_strength < 0.3:
25
  genre = "Hip Hop / Trap"
26
+ elif 100 < tempo < 130 and centroid > 2300 and chroma_strength > 0.7:
27
  genre = "Pop / Rock"
28
+ elif centroid < 1800 and chroma_strength > 0.9:
29
  genre = "Jazz / Soul"
30
  else:
31
  genre = "Unknown"