Convert to three-channel if needed in spectrogram_from_image
Closes: #51 Topic: convert_three_channel
This commit is contained in:
parent
89f3946155
commit
ce8744897b
|
@ -77,6 +77,10 @@ def spectrogram_from_image(
|
||||||
Returns:
|
Returns:
|
||||||
spectrogram: (channels, frequency, time)
|
spectrogram: (channels, frequency, time)
|
||||||
"""
|
"""
|
||||||
|
# Convert to RGB if single channel
|
||||||
|
if image.mode in ("P", "L"):
|
||||||
|
image = image.convert("RGB")
|
||||||
|
|
||||||
# Flip Y
|
# Flip Y
|
||||||
image = image.transpose(Image.Transpose.FLIP_TOP_BOTTOM)
|
image = image.transpose(Image.Transpose.FLIP_TOP_BOTTOM)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue