Fix registration of text masks (#2501)

- Scale and crop not applied correctly
- Problem found and fixed by @spezialspezial
- Closes #2470
This commit is contained in:
Lincoln Stein
2023-02-04 10:48:27 -05:00
committed by GitHub

View File

@ -101,10 +101,9 @@ class Txt2Mask(object):
image = ImageOps.exif_transpose(image)
img = self._scale_and_crop(image)
img = transform(img).unsqueeze(0)
inputs = self.processor(text=[prompt],
images=[image],
images=[img],
padding=True,
return_tensors='pt')
outputs = self.model(**inputs)