devendergarg14 commited on
Commit
65bafb4
·
verified ·
1 Parent(s): 4ef0932

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -48,9 +48,9 @@ def process_image(image, categories_to_hide):
48
  if "Clothes" in categories_to_hide:
49
  clothing_mask = np.isin(mask_data, grouped_mapping["Clothes"]).astype(np.uint8)
50
 
51
- # Determine kernel size (5% of the smaller image dimension)
52
  height, width = clothing_mask.shape
53
- kernel_size = max(1, int(0.05 * min(height, width))) # Ensure at least 1 pixel
54
  kernel = np.ones((kernel_size, kernel_size), np.uint8)
55
 
56
  # Dilate the clothing mask
 
48
  if "Clothes" in categories_to_hide:
49
  clothing_mask = np.isin(mask_data, grouped_mapping["Clothes"]).astype(np.uint8)
50
 
51
+ # Determine kernel size (3% of the smaller image dimension)
52
  height, width = clothing_mask.shape
53
+ kernel_size = max(1, int(0.03 * min(height, width))) # Ensure at least 1 pixel
54
  kernel = np.ones((kernel_size, kernel_size), np.uint8)
55
 
56
  # Dilate the clothing mask