huggingface / huggingface/diffusers
Bugs in PixArtImageProcessor.resize_and_crop_tensor
- Vorherrschende Sprache
- Python
- Sterne
- 34.5k
- Forks
- 7.3k
- Ø Merge
- 3 T. 3 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### 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_
Beitragsleitfaden
Rechercherichtung
Start at PixArtImageProcessor.resize_and_crop_tensor and run the reproduction from the issue with the specified input and target sizes. Trace the returned tensor shape and verify the result is torch.Size([1, 3, 960, 1280]); done means the reported case produces the expected height and width without breaking the method’s existing behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, pytorch
- Bereich
- computer-vision, machine-learning
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 68/100