Skip to content

Commit 16f560c

Browse files
committed
Fix overlay
1 parent da850b0 commit 16f560c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

superannotate/db/images.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,11 @@ def create_fuse_image(
10361036
annotation["angle"], 0, 360, fill_color[:-1], 1
10371037
)
10381038
new_array_ovl = np.array(fi_pil_ovl)
1039-
new_array_ovl[:, :, :-1] += temp_ovl
1039+
temp_mask = np.alltrue(temp_ovl != [0, 0, 0], axis=2)
1040+
new_array_ovl[:, :, :-1] = np.where(
1041+
temp_mask[:, :, np.newaxis], temp_ovl,
1042+
new_array_ovl[:, :, :-1]
1043+
)
10401044
fi_pil_ovl = Image.fromarray(new_array_ovl)
10411045
draw_ovl = ImageDraw.Draw(fi_pil_ovl)
10421046
cv2.ellipse(

0 commit comments

Comments
 (0)