huggingface / huggingface/diffusers
Bugs in PixArtImageProcessor.resize_and_crop_tensor
- 主要言語
- Python
- スター
- 34.5k
- フォーク
- 7.3k
- 平均マージ
- 3日 3時間
- マージ済み PR(30日)
- 91
説明
### 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_
コントリビューションガイド
調査の方向性
PixArtImageProcessor.resize_and_crop_tensorから開始し、指定された入力サイズとターゲットサイズでissueの再現を実行します。返されたテンソルの形状を追跡し、結果がtorch.Size([1, 3, 960, 1280])であることを確認します。報告されたケースで、メソッドの既存の動作を壊すことなく期待される高さと幅が生成されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python, pytorch
- 領域
- computer-vision, machine-learning
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 68/100