forked from fgnt/mms_msg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import contextlib | ||
from collections import defaultdict | ||
|
||
import paderbox as pb | ||
|
||
|
||
def plot_meeting(ex): | ||
with pb.visualization.axes_context(columns=1, figure_size=(10, 3)) as ac: | ||
speech_activity = defaultdict(pb.array.interval.zeros) | ||
num_samples = pb.utils.nested.get_by_path(ex, 'num_samples.original_source', allow_early_stopping=True) | ||
for o, l, s, in zip(ex['offset']['original_source'], num_samples, ex['speaker_id']): | ||
speech_activity[s][o:o + l] = True | ||
def plot_mixture(ex, ax=None): | ||
if ax is None: | ||
from matplotlib import pyplot as plt | ||
_, ax = plt.subplots(1, 1) | ||
speech_activity = defaultdict(pb.array.interval.zeros) | ||
num_samples = pb.utils.nested.get_by_path(ex, 'num_samples.original_source', allow_early_stopping=True) | ||
for o, l, s, in zip(ex['offset']['original_source'], num_samples, ex['speaker_id']): | ||
speech_activity[s][o:o + l] = True | ||
|
||
pb.visualization.plot.activity(speech_activity, ax=ac.new) | ||
pb.visualization.plot.activity(speech_activity, ax=ax) | ||
ax.axvline(ex['num_samples']['observation']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters