fix(deps): update dependency pillow to v10.3.0 [security] ()

* fix(deps): update dependency pillow to v10.3.0 [security]

* fix typing

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>
This commit is contained in:
renovate[bot] 2024-04-11 05:48:09 +00:00 committed by GitHub
parent 1bca1b8bde
commit 640f53fe0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 72 additions and 71 deletions
machine-learning/app/models

View file

@ -7,9 +7,9 @@ _PIL_RESAMPLING_METHODS = {resampling.name.lower(): resampling for resampling in
def resize(img: Image.Image, size: int) -> Image.Image:
if img.width < img.height:
return img.resize((size, int((img.height / img.width) * size)), resample=Image.BICUBIC)
return img.resize((size, int((img.height / img.width) * size)), resample=Image.Resampling.BICUBIC)
else:
return img.resize((int((img.width / img.height) * size), size), resample=Image.BICUBIC)
return img.resize((int((img.width / img.height) * size), size), resample=Image.Resampling.BICUBIC)
# https://stackoverflow.com/a/60883103