patrickligardes commited on
Commit
c018897
β€’
1 Parent(s): 5de6007

Update utils_mask.py

Browse files
Files changed (1) hide show
  1. utils_mask.py +4 -0
utils_mask.py CHANGED
@@ -89,6 +89,10 @@ def get_mask_location(model_type, category, model_parse: Image.Image, keypoint:
89
  parse_mask += (parse_array == 12).astype(np.float32) + \
90
  (parse_array == 13).astype(np.float32)
91
 
 
 
 
 
92
  elif category == 'upper_body':
93
  parse_mask = (parse_array == 4).astype(np.float32) + (parse_array == 7).astype(np.float32)
94
  parser_mask_fixed_lower_cloth = (parse_array == label_map["skirt"]).astype(np.float32) + \
 
89
  parse_mask += (parse_array == 12).astype(np.float32) + \
90
  (parse_array == 13).astype(np.float32)
91
 
92
+ # Fill gaps between legs
93
+ leg_mask = cv2.dilate(parse_mask.astype(np.uint8), np.ones((5, 5), np.uint8), iterations=5)
94
+ parse_mask += leg_mask
95
+
96
  elif category == 'upper_body':
97
  parse_mask = (parse_array == 4).astype(np.float32) + (parse_array == 7).astype(np.float32)
98
  parser_mask_fixed_lower_cloth = (parse_array == label_map["skirt"]).astype(np.float32) + \