itsyogesh commited on
Commit
7c3ff1d
·
verified ·
1 Parent(s): e10b294

Fix inference issues

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -176,17 +176,16 @@ def inference(image):
176
  # Process the mask without cropping
177
  processed_mask = smooth_and_denoise(mask)
178
 
179
- # Convert processed mask to PIL image and resize to match original image
180
  pil_mask = Image.fromarray(processed_mask).convert('L')
181
  im_rgb = Image.open(image).convert("RGB")
182
- pil_mask_resized = pil_mask.resize(im_rgb.size, Image.ANTIALIAS)
183
 
184
  im_dark = Image.new('RGB', im_rgb.size, (0, 0, 0))
185
 
186
- # Apply resized mask to images
187
  im_rgba = im_rgb.copy()
188
- im_rgba.putalpha(pil_mask_resized)
189
- im_dark.putalpha(pil_mask_resized)
190
 
191
  return [im_rgba, pil_mask, im_dark]
192
 
 
176
  # Process the mask without cropping
177
  processed_mask = smooth_and_denoise(mask)
178
 
179
+ # Convert processed mask to PIL image
180
  pil_mask = Image.fromarray(processed_mask).convert('L')
181
  im_rgb = Image.open(image).convert("RGB")
 
182
 
183
  im_dark = Image.new('RGB', im_rgb.size, (0, 0, 0))
184
 
185
+ # Apply mask to images
186
  im_rgba = im_rgb.copy()
187
+ im_rgba.putalpha(pil_mask)
188
+ im_dark.putalpha(pil_mask)
189
 
190
  return [im_rgba, pil_mask, im_dark]
191