Skip to content

Commit 639067d

Browse files
committed
update grid.py
1 parent c8ef96c commit 639067d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

streamgrid/grid.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ def update_display(self):
369369

370370
# Add source label with adaptive sizing
371371
info = f"Source #{i}"
372-
text_scale = max(1.2, min(0.8, self.cell_w / 400))
373-
thickness = max(3, int(text_scale * 3))
374-
padding = max(10, int(self.cell_w / 100))
372+
text_scale = max(1.6, min(0.8, self.cell_w / 400))
373+
thickness = max(4, int(text_scale * 3))
374+
padding = max(15, int(self.cell_w / 100))
375375

376376
# Calculate text dimensions
377377
(text_width, text_height), baseline = cv2.getTextSize(
@@ -415,8 +415,8 @@ def _draw_fps_overlay(self):
415415
fps_text = f"Prediction FPS: {self.prediction_fps:.1f}"
416416

417417
# Scale text size based on grid dimensions
418-
text_scale = max(0.8, min(1.5, (self.cols * self.cell_w) / 800))
419-
thickness = max(2, int(text_scale * 2))
418+
text_scale = max(1.6, min(1.5, (self.cols * self.cell_w) / 800))
419+
thickness = max(4, int(text_scale * 2))
420420

421421
# Calculate text dimensions
422422
(text_w, text_h), baseline = cv2.getTextSize(
@@ -428,7 +428,7 @@ def _draw_fps_overlay(self):
428428
bottom_y = self.rows * self.cell_h - max(10, int(text_scale * 10))
429429

430430
# Draw background rectangle
431-
padding = max(8, int(text_scale * 8))
431+
padding = max(20, int(text_scale * 8))
432432
cv2.rectangle(self.grid,
433433
(center_x - padding, bottom_y - text_h - padding),
434434
(center_x + text_w + padding, bottom_y + padding),

0 commit comments

Comments
 (0)