wondervictor commited on
Commit
7f589c6
·
verified ·
1 Parent(s): e53c1e6

Update mask_adapter/sam_maskadapter.py

Browse files
Files changed (1) hide show
  1. mask_adapter/sam_maskadapter.py +2 -2
mask_adapter/sam_maskadapter.py CHANGED
@@ -387,8 +387,8 @@ class SAMPointVisualizationDemo(object):
387
  label = f"{self.class_names[max_score_idx.item()]}: {max_scores.item():.2f}"
388
 
389
  # Dynamically place the label near the clicked point
390
- text_x = min(width - 200, points[0][0] + 20) # Add some offset from the point
391
- text_y = min(height - 30, points[0][1] + 20) # Ensure the text does not go out of bounds
392
 
393
  # Put text near the point
394
  cv2.putText(overlay, label, (text_x, text_y), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2)
 
387
  label = f"{self.class_names[max_score_idx.item()]}: {max_scores.item():.2f}"
388
 
389
  # Dynamically place the label near the clicked point
390
+ text_x = min(width - 200, points[0][0] + 5) # Add some offset from the point
391
+ text_y = min(height - 30, points[0][1] + 10) # Ensure the text does not go out of bounds
392
 
393
  # Put text near the point
394
  cv2.putText(overlay, label, (text_x, text_y), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2)