Fix FeatherMask

This commit is contained in:
Jairo Correa 2023-10-13 12:26:54 -03:00
parent fee3b0c070
commit 87097a11c3
1 changed files with 4 additions and 4 deletions

View File

@ -282,10 +282,10 @@ class FeatherMask:
def feather(self, mask, left, top, right, bottom): def feather(self, mask, left, top, right, bottom):
output = mask.reshape((-1, mask.shape[-2], mask.shape[-1])).clone() output = mask.reshape((-1, mask.shape[-2], mask.shape[-1])).clone()
left = min(left, output.shape[1]) left = min(left, output.shape[-1])
right = min(right, output.shape[1]) right = min(right, output.shape[-1])
top = min(top, output.shape[0]) top = min(top, output.shape[-2])
bottom = min(bottom, output.shape[0]) bottom = min(bottom, output.shape[-2])
for x in range(left): for x in range(left):
feather_rate = (x + 1.0) / left feather_rate = (x + 1.0) / left