File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,9 @@ def plot_spectrogram_to_numpy(spectrogram):
142142 fig .canvas .draw ()
143143 try :
144144 data = np .array (fig .canvas .renderer .buffer_rgba (), dtype = np .uint8 )
145- data = data .reshape (fig .canvas .get_width_height ()[::- 1 ] + (4 ,))[:, :, :3 ] # 只取前三个通道(RGB)
145+ data = data .reshape (fig .canvas .get_width_height ()[::- 1 ] + (4 ,))[
146+ :, :, :3
147+ ] # 只取前三个通道(RGB)
146148 except :
147149 data = np .fromstring (fig .canvas .tostring_rgb (), dtype = np .uint8 , sep = "" )
148150 data = data .reshape (fig .canvas .get_width_height ()[::- 1 ] + (3 ,))
@@ -175,7 +177,9 @@ def plot_alignment_to_numpy(alignment, info=None):
175177 fig .canvas .draw ()
176178 try :
177179 data = np .array (fig .canvas .renderer .buffer_rgba (), dtype = np .uint8 )
178- data = data .reshape (fig .canvas .get_width_height ()[::- 1 ] + (4 ,))[:, :, :3 ] # 只取前三个通道(RGB)
180+ data = data .reshape (fig .canvas .get_width_height ()[::- 1 ] + (4 ,))[
181+ :, :, :3
182+ ] # 只取前三个通道(RGB)
179183 except :
180184 data = np .fromstring (fig .canvas .tostring_rgb (), dtype = np .uint8 , sep = "" )
181185 data = data .reshape (fig .canvas .get_width_height ()[::- 1 ] + (3 ,))
You can’t perform that action at this time.
0 commit comments