Ashrafb commited on
Commit
7624098
·
verified ·
1 Parent(s): cb1e745

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -29,6 +29,11 @@ def segment_image(image):
29
  person_class_id = 15 # Adjust based on the model's class mapping
30
  mask = (segmentation == person_class_id).astype(np.uint8)
31
 
 
 
 
 
 
32
  return mask
33
 
34
  # Apply style transfer to different layers
 
29
  person_class_id = 15 # Adjust based on the model's class mapping
30
  mask = (segmentation == person_class_id).astype(np.uint8)
31
 
32
+ # Resize mask to match the input image size
33
+ mask = Image.fromarray(mask)
34
+ mask = mask.resize(image.size, resample=Image.NEAREST)
35
+ mask = np.array(mask)
36
+
37
  return mask
38
 
39
  # Apply style transfer to different layers