Skip to content

Commit

Permalink
chore(format): run black on dev (#104)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Dec 31, 2024
1 parent fe11be3 commit b055262
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions infer/lib/train/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,))
Expand Down Expand Up @@ -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,))
Expand Down

0 comments on commit b055262

Please sign in to comment.