Spaces:
Running
on
Zero
Running
on
Zero
Update mask_adapter/sam_maskadapter.py
Browse files
mask_adapter/sam_maskadapter.py
CHANGED
@@ -424,7 +424,7 @@ class SAMPointVisualizationDemo(object):
|
|
424 |
|
425 |
# Dynamically place the label near the clicked point
|
426 |
text_x = min(width - 200, bbox[0] + 20) # Add some offset from the point
|
427 |
-
text_y = min(height - 30, bbox[1] +
|
428 |
|
429 |
# Put text near the point
|
430 |
cv2.putText(overlay, label, (text_x, text_y), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2)
|
|
|
424 |
|
425 |
# Dynamically place the label near the clicked point
|
426 |
text_x = min(width - 200, bbox[0] + 20) # Add some offset from the point
|
427 |
+
text_y = min(height - 30, bbox[1] + 5) # Ensure the text does not go out of bounds
|
428 |
|
429 |
# Put text near the point
|
430 |
cv2.putText(overlay, label, (text_x, text_y), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2)
|