提交 496e2dd1 编写于 作者: 小湉湉's avatar 小湉湉

fix Pillow's version

上级 bc93bffb
...@@ -22,6 +22,7 @@ onnxruntime ...@@ -22,6 +22,7 @@ onnxruntime
pandas pandas
paddlenlp paddlenlp
paddlespeech_feat paddlespeech_feat
Pillow>=9.0.0
praatio==5.0.0 praatio==5.0.0
pypinyin pypinyin
pypinyin-dict pypinyin-dict
......
...@@ -16,7 +16,6 @@ import random ...@@ -16,7 +16,6 @@ import random
import numpy as np import numpy as np
from PIL import Image from PIL import Image
from PIL.Image import Resampling
from paddlespeech.s2t.frontend.augmentor.base import AugmentorBase from paddlespeech.s2t.frontend.augmentor.base import AugmentorBase
from paddlespeech.s2t.utils.log import Log from paddlespeech.s2t.utils.log import Log
...@@ -164,9 +163,9 @@ class SpecAugmentor(AugmentorBase): ...@@ -164,9 +163,9 @@ class SpecAugmentor(AugmentorBase):
window) + 1 # 1 ... t - 1 window) + 1 # 1 ... t - 1
left = Image.fromarray(x[:center]).resize((x.shape[1], warped), left = Image.fromarray(x[:center]).resize((x.shape[1], warped),
Resampling.BICUBIC) Image.BICUBIC)
right = Image.fromarray(x[center:]).resize((x.shape[1], t - warped), right = Image.fromarray(x[center:]).resize((x.shape[1], t - warped),
Resampling.BICUBIC) Image.BICUBIC)
if self.inplace: if self.inplace:
x[:warped] = left x[:warped] = left
x[warped:] = right x[warped:] = right
......
...@@ -14,10 +14,8 @@ ...@@ -14,10 +14,8 @@
# Modified from espnet(https://github.com/espnet/espnet) # Modified from espnet(https://github.com/espnet/espnet)
"""Spec Augment module for preprocessing i.e., data augmentation""" """Spec Augment module for preprocessing i.e., data augmentation"""
import random import random
import numpy import numpy
from PIL import Image from PIL import Image
from PIL.Image import Resampling
from paddlespeech.s2t.transform.functional import FuncTrans from paddlespeech.s2t.transform.functional import FuncTrans
...@@ -47,9 +45,9 @@ def time_warp(x, max_time_warp=80, inplace=False, mode="PIL"): ...@@ -47,9 +45,9 @@ def time_warp(x, max_time_warp=80, inplace=False, mode="PIL"):
window) + 1 # 1 ... t - 1 window) + 1 # 1 ... t - 1
left = Image.fromarray(x[:center]).resize((x.shape[1], warped), left = Image.fromarray(x[:center]).resize((x.shape[1], warped),
Resampling.BICUBIC) Image.BICUBIC)
right = Image.fromarray(x[center:]).resize((x.shape[1], t - warped), right = Image.fromarray(x[center:]).resize((x.shape[1], t - warped),
Resampling.BICUBIC) Image.BICUBIC)
if inplace: if inplace:
x[:warped] = left x[:warped] = left
x[warped:] = right x[warped:] = right
......
...@@ -48,6 +48,7 @@ base = [ ...@@ -48,6 +48,7 @@ base = [
"pandas", "pandas",
"paddlenlp", "paddlenlp",
"paddlespeech_feat", "paddlespeech_feat",
"Pillow>=9.0.0"
"praatio==5.0.0", "praatio==5.0.0",
"pypinyin", "pypinyin",
"pypinyin-dict", "pypinyin-dict",
...@@ -87,7 +88,6 @@ requirements = { ...@@ -87,7 +88,6 @@ requirements = {
"gpustat", "gpustat",
"paddlespeech_ctcdecoders", "paddlespeech_ctcdecoders",
"phkit", "phkit",
"Pillow",
"pybind11", "pybind11",
"pypi-kenlm", "pypi-kenlm",
"snakeviz", "snakeviz",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册