Image transforms add center crop (#19718)

* Add center crop to transforms library

* Return PIL images if PIL image input by default

* Fixup and add docstring

* Trigger CI

* Update src/transformers/image_transforms.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Update src/transformers/image_transforms.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* PR comments - move comments; unindent

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
amyeroberts
2022-10-19 16:15:01 +01:00
committed by GitHub
parent 44a40c1466
commit 5041bc3511
3 changed files with 120 additions and 0 deletions

View File

@@ -19,6 +19,8 @@ Most of those are only useful if you are studying the code of the image processo
## Image Transformations
[[autodoc]] image_transforms.center_crop
[[autodoc]] image_transforms.normalize
[[autodoc]] image_transforms.rescale