Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/art/utils/old_benchmarking/display_image_grid.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import html

from IPython.display import HTML, display


Expand All @@ -6,6 +8,7 @@ def display_image_grid(image_paths: list[str], images_per_row: int = 2):
<div style='display: grid; grid-template-columns: repeat({images_per_row}, 1fr); gap: 10px;'>
"""
for path in image_paths:
html += f"<img src='{path}' style='max-width: 100%; height: auto;'>"
escaped_path = html.escape(path)
html += f"<img src='{escaped_path}' style='max-width: 100%; height: auto;'>"
html += "</div>"
display(HTML(html))