Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -96,9 +96,9 @@ def _load_palette(path="plotly_colorwheel.txt"):
|
|
| 96 |
return FALLBACK
|
| 97 |
|
| 98 |
_PALETTE = _load_palette()
|
| 99 |
-
# Reserved
|
| 100 |
-
#
|
| 101 |
-
_RESERVED = {0, 9,
|
| 102 |
_SPEAKER_PALETTE = [c for i, c in enumerate(_PALETTE) if i not in _RESERVED]
|
| 103 |
|
| 104 |
|
|
@@ -366,7 +366,8 @@ def _voice_color_map(df5_labels, speaker_color_map):
|
|
| 366 |
color_map = {
|
| 367 |
"Single Voice": _PALETTE[0],
|
| 368 |
"Multi Voice": _PALETTE[9],
|
| 369 |
-
"No Voice": _PALETTE[
|
|
|
|
| 370 |
}
|
| 371 |
speaker_labels = [l for l in df5_labels if l not in top_labels]
|
| 372 |
for i, lbl in enumerate(speaker_labels):
|
|
|
|
| 96 |
return FALLBACK
|
| 97 |
|
| 98 |
_PALETTE = _load_palette()
|
| 99 |
+
# Reserved indices — must match plotly_colorwheel.txt:
|
| 100 |
+
# 0 = Single Voice, 9 = Multi Voice, 24 = No Voice, 31 = Unassigned
|
| 101 |
+
_RESERVED = {0, 9, 24, 31}
|
| 102 |
_SPEAKER_PALETTE = [c for i, c in enumerate(_PALETTE) if i not in _RESERVED]
|
| 103 |
|
| 104 |
|
|
|
|
| 366 |
color_map = {
|
| 367 |
"Single Voice": _PALETTE[0],
|
| 368 |
"Multi Voice": _PALETTE[9],
|
| 369 |
+
"No Voice": _PALETTE[24],
|
| 370 |
+
"Unassigned": _PALETTE[31] if len(_PALETTE) > 31 else "#777a7d",
|
| 371 |
}
|
| 372 |
speaker_labels = [l for l in df5_labels if l not in top_labels]
|
| 373 |
for i, lbl in enumerate(speaker_labels):
|