skytnt commited on
Commit
c8b91a0
1 Parent(s): 45d2b45

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +1 -1
pipeline.py CHANGED
@@ -374,7 +374,7 @@ def preprocess_mask(mask, scale_factor=8):
374
  mask = mask.convert("L")
375
  w, h = mask.size
376
  w, h = map(lambda x: x - x % 32, (w, h)) # resize to integer multiple of 32
377
- mask = mask.resize((w // scale_factor, h // scale_factor), resample=PIL.Image.NEAREST)
378
  mask = np.array(mask).astype(np.float32) / 255.0
379
  mask = np.tile(mask, (4, 1, 1))
380
  mask = mask[None].transpose(0, 1, 2, 3) # what does this step do?
 
374
  mask = mask.convert("L")
375
  w, h = mask.size
376
  w, h = map(lambda x: x - x % 32, (w, h)) # resize to integer multiple of 32
377
+ mask = mask.resize((w // scale_factor, h // scale_factor), resample=PIL_INTERPOLATION["nearest"])
378
  mask = np.array(mask).astype(np.float32) / 255.0
379
  mask = np.tile(mask, (4, 1, 1))
380
  mask = mask[None].transpose(0, 1, 2, 3) # what does this step do?