resemble-ai / Resemblyzer

A python package to analyze and compare voices with deep learning
Apache License 2.0
2.66k stars 419 forks source link

MATPLOTLIB FIGURES NOT DISPLAYING..How to solve this please help.. #78

Open MrinmoyBoruah opened 1 year ago

MrinmoyBoruah commented 1 year ago

from mpl_toolkits.axes_grid1 import make_axes_locatable from matplotlib.animation import FuncAnimation from resemblyzer.audio import sampling_rate from matplotlib import cm from time import sleep, perf_counter as timer from umap import UMAP from sys import stderr import matplotlib.pyplot as plt import numpy as np from itertools import groupby from pathlib import Path from tqdm import tqdm from resemblyzer import preprocess_wav, VoiceEncoder from itertools import groupby

wav_fpaths = list(Path("audio_data", "librispeech_test-other").glob("*/.flac")) speakers = list(map(lambda wav_fpath: wav_fpath.parent.stem, wav_fpaths)) wavs = np.array(list(map(preprocess_wav, tqdm(wav_fpaths, "Preprocessing wavs", len(wav_fpaths))))) speaker_wavs = {speaker: wavs[list(indices)] for speaker, indices in groupby(range(len(wavs)), lambda i: speakers[i])} encoder = VoiceEncoder() utterance_embeds = np.array(list(map(encoder.embed_utterance, wavs)))

def plot_projections(embeds, speakers, ax=None, colors=None, markers=None, legend=True, title="", **kwargs):(utterance_embeds, speakers, title="Embedding projections")

plt.show()

MATPLOTLIB FIGURES ARE NOT DISPLAYING.

Kiri0824 commented 4 months ago

hi, i met same issue, i use vscode jupyter to show the fig, only show the axis, but i use ani.save("animation.mp4", fps=20, writer="ffmpeg") in util.py: interactive_diarization function, the file i saved can display correctly. And i found other problem, the animation delayed. #47

Kiri0824 commented 4 months ago

sorry, the fps might not be 20, i think 16 might be great?