From 7cfbacdeda46162949a60d78ca37f5d4cfb2d969 Mon Sep 17 00:00:00 2001 From: Pepijn Date: Tue, 30 Jun 2026 14:20:10 +0200 Subject: [PATCH] feat(annotate): legible tile-scaled timestamp on contact sheets The burned-in timestamp used the ~10px bitmap default font, which blurs once the model downsamples a full contact sheet into 768px tiles, so the VLM can no longer read the exact source time a boundary depends on. Scale the timestamp to the tile height (with a graceful fallback on older Pillow) so the visual time cue stays readable at sheet resolution. Co-authored-by: Cursor --- src/lerobot/annotations/steerable_pipeline/frames.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lerobot/annotations/steerable_pipeline/frames.py b/src/lerobot/annotations/steerable_pipeline/frames.py index 5a6a5879c..403581132 100644 --- a/src/lerobot/annotations/steerable_pipeline/frames.py +++ b/src/lerobot/annotations/steerable_pipeline/frames.py @@ -413,7 +413,16 @@ def _draw_timestamp_badge(image: PIL.Image.Image, timestamp: float) -> PIL.Image result = image.copy() draw = ImageDraw.Draw(result) - font = ImageFont.load_default() + # Scale the timestamp to the tile so it stays legible after the model + # downsamples the full sheet into 768px tiles — a tiny bitmap font blurs + # at contact-sheet resolution and the VLM can no longer read the exact + # source time, which is what the boundary score depends on. ``size=`` is + # supported by Pillow's bitmap default since 10.1; fall back otherwise. + badge_px = max(14, round(image.height * 0.12)) + try: + font = ImageFont.load_default(size=badge_px) + except TypeError: + font = ImageFont.load_default() label = f"{timestamp:06.2f}s" left, top, right, bottom = draw.textbbox((0, 0), label, font=font) text_w, text_h = right - left, bottom - top