huggingface / huggingface/diffusers
Bugs in PixArtImageProcessor.resize_and_crop_tensor
Open
bug
stale
- Dominant language
- Python
- Stars
- 34.5k
- Forks
- 7.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 91
Description
### Describe the bug
`PixArtImageProcessor.resize_and_crop_tensor` returns image with incorrect size
### Reproduction
```python
import torch
from diffusers.image_processor import PixArtImageProcessor
orig_height, orig_width = (832, 1152)
new_height, new_width = (960, 1280)
image = torch.rand((1, 3, orig_height, orig_width))
image = PixArtImageProcessor.resize_and_crop_tensor(image, new_width, new_height)
print(image.size())
# expected: torch.Size([1, 3, 960, 1280])
# actual: torch.Size([1, 3, 1, 1280])
```
### Logs
_No response_
### System Info
diffusers==0.30.0.dev0
### Who can help?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.