1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 01:10:22 +08:00

chore(format): run black on dev (#104)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2025-01-01 00:24:50 +09:00
committed by GitHub
parent fe11be3c94
commit b0552625f7

View File

@@ -142,7 +142,9 @@ def plot_spectrogram_to_numpy(spectrogram):
fig.canvas.draw()
try:
data = np.array(fig.canvas.renderer.buffer_rgba(), dtype=np.uint8)
data = data.reshape(fig.canvas.get_width_height()[::-1] + (4,))[:, :, :3] # 只取前三个通道RGB
data = data.reshape(fig.canvas.get_width_height()[::-1] + (4,))[
:, :, :3
] # 只取前三个通道RGB
except:
data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep="")
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
@@ -175,7 +177,9 @@ def plot_alignment_to_numpy(alignment, info=None):
fig.canvas.draw()
try:
data = np.array(fig.canvas.renderer.buffer_rgba(), dtype=np.uint8)
data = data.reshape(fig.canvas.get_width_height()[::-1] + (4,))[:, :, :3] # 只取前三个通道RGB
data = data.reshape(fig.canvas.get_width_height()[::-1] + (4,))[
:, :, :3
] # 只取前三个通道RGB
except:
data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep="")
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))