Spaces:
Running
on
L40S
Running
on
L40S
franciszzj
commited on
Commit
β’
a8825cc
1
Parent(s):
a72d826
update mask
Browse files- leffa_utils/utils.py +4 -1
leffa_utils/utils.py
CHANGED
@@ -204,9 +204,12 @@ def get_agnostic_mask_hd(model_parse, keypoint, category, size=(384, 512)):
|
|
204 |
hands_right = np.logical_and(np.logical_not(im_arms_right), arms_right)
|
205 |
parser_mask_fixed += hands_left + hands_right
|
206 |
|
|
|
|
|
|
|
207 |
parser_mask_fixed = np.logical_or(parser_mask_fixed, parse_head)
|
208 |
parse_mask = cv2.dilate(parse_mask, np.ones(
|
209 |
-
(
|
210 |
if category == 'dresses' or category == 'upper_body':
|
211 |
neck_mask = (parse_array == 18).astype(np.float32)
|
212 |
neck_mask = cv2.dilate(neck_mask, np.ones(
|
|
|
204 |
hands_right = np.logical_and(np.logical_not(im_arms_right), arms_right)
|
205 |
parser_mask_fixed += hands_left + hands_right
|
206 |
|
207 |
+
parser_mask_fixed = cv2.erode(parser_mask_fixed, np.ones(
|
208 |
+
(5, 5), np.uint16), iterations=1)
|
209 |
+
|
210 |
parser_mask_fixed = np.logical_or(parser_mask_fixed, parse_head)
|
211 |
parse_mask = cv2.dilate(parse_mask, np.ones(
|
212 |
+
(10, 10), np.uint16), iterations=5)
|
213 |
if category == 'dresses' or category == 'upper_body':
|
214 |
neck_mask = (parse_array == 18).astype(np.float32)
|
215 |
neck_mask = cv2.dilate(neck_mask, np.ones(
|