Spaces:
Running
on
Zero
Running
on
Zero
Update utils_mask.py
#10
by
karade12
- opened
- utils_mask.py +12 -2
utils_mask.py
CHANGED
@@ -100,8 +100,18 @@ def get_mask_location(model_type, category, model_parse: Image.Image, keypoint:
|
|
100 |
(parse_array == 14).astype(np.float32) + \
|
101 |
(parse_array == 15).astype(np.float32)
|
102 |
parser_mask_changeable += np.logical_and(parse_array, np.logical_not(parser_mask_fixed))
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
# Load pose points
|
107 |
pose_data = keypoint["pose_keypoints_2d"]
|
|
|
100 |
(parse_array == 14).astype(np.float32) + \
|
101 |
(parse_array == 15).astype(np.float32)
|
102 |
parser_mask_changeable += np.logical_and(parse_array, np.logical_not(parser_mask_fixed))
|
103 |
+
elif category == 'saree':
|
104 |
+
# Treat saree as a combination of dress + upper cloth + part of skirt
|
105 |
+
parse_mask = (parse_array == 7).astype(np.float32) + \
|
106 |
+
(parse_array == 4).astype(np.float32) + \
|
107 |
+
(parse_array == 5).astype(np.float32)
|
108 |
+
|
109 |
+
parser_mask_fixed += (parse_array == label_map["pants"]).astype(np.float32)
|
110 |
+
parser_mask_fixed += (parse_array == 14).astype(np.float32) + \
|
111 |
+
(parse_array == 15).astype(np.float32)
|
112 |
+
|
113 |
+
parser_mask_changeable += np.logical_and(parse_array, np.logical_not(parser_mask_fixed))
|
114 |
+
|
115 |
|
116 |
# Load pose points
|
117 |
pose_data = keypoint["pose_keypoints_2d"]
|