duongthienz commited on
Commit
7793e68
·
verified ·
1 Parent(s): 26395f7

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +5 -4
utils.py CHANGED
@@ -96,9 +96,9 @@ def _load_palette(path="plotly_colorwheel.txt"):
96
  return FALLBACK
97
 
98
  _PALETTE = _load_palette()
99
- # Reserved: 0 = Single Voice (red shade 0), 9 = Multi Voice (green shade 0),
100
- # 24 = No Voice (grey). Speakers use all other indices.
101
- _RESERVED = {0, 9, len(_PALETTE) - 1}
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[-1],
 
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):