Skip to content

Commit

Permalink
Fix empty mask overlay handling when no objects are detected. (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
ro-hit81 authored Oct 22, 2024
1 parent 8888ba6 commit 7d1d648
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion samgeo/text_sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,10 @@ def predict(

if boxes.nelement() == 0: # No "object" instances found
print("No objects found in the image.")
return
mask_overlay = np.zeros_like(
image_np[..., 0], dtype=dtype
) # Create an empty mask overlay

else:
# Create an empty image to store the mask overlays
mask_overlay = np.zeros_like(
Expand Down

0 comments on commit 7d1d648

Please sign in to comment.