Spaces:
Running
Running
jhj0517
commited on
Commit
•
3d1dda1
1
Parent(s):
cb60fd1
Fix type hint
Browse files- modules/mask_utils.py +3 -3
modules/mask_utils.py
CHANGED
@@ -65,7 +65,7 @@ def create_mask_layers(
|
|
65 |
def create_mask_gallery(
|
66 |
image: np.ndarray,
|
67 |
masks: List[Dict]
|
68 |
-
) -> List
|
69 |
"""
|
70 |
Create list of images with mask data. Masks are sorted by area in descending order. Specially used for gradio
|
71 |
Gallery component. each element has image and label, where label is the part number.
|
@@ -98,7 +98,7 @@ def create_mask_gallery(
|
|
98 |
def create_mask_combined_images(
|
99 |
image: np.ndarray,
|
100 |
masks: List[Dict]
|
101 |
-
) -> List
|
102 |
"""
|
103 |
Create an image with colored masks. Each mask is colored with a random color and blended with the original image.
|
104 |
|
@@ -107,7 +107,7 @@ def create_mask_combined_images(
|
|
107 |
masks: List of mask data
|
108 |
|
109 |
Returns:
|
110 |
-
|
111 |
"""
|
112 |
final_result = np.zeros_like(image)
|
113 |
used_colors = set()
|
|
|
65 |
def create_mask_gallery(
|
66 |
image: np.ndarray,
|
67 |
masks: List[Dict]
|
68 |
+
) -> List:
|
69 |
"""
|
70 |
Create list of images with mask data. Masks are sorted by area in descending order. Specially used for gradio
|
71 |
Gallery component. each element has image and label, where label is the part number.
|
|
|
98 |
def create_mask_combined_images(
|
99 |
image: np.ndarray,
|
100 |
masks: List[Dict]
|
101 |
+
) -> List:
|
102 |
"""
|
103 |
Create an image with colored masks. Each mask is colored with a random color and blended with the original image.
|
104 |
|
|
|
107 |
masks: List of mask data
|
108 |
|
109 |
Returns:
|
110 |
+
[image, label] pairs
|
111 |
"""
|
112 |
final_result = np.zeros_like(image)
|
113 |
used_colors = set()
|