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
commit 17e8f966d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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