pulsatrix
Loading...
Searching...
No Matches
pulsatrix::ImageGridView Class Reference

Draws a grid of image samples from a Dataset whose first Sample field is a decoded (1,C,H,W) or (C,H,W) image tensor (e.g. ImageFolderDataset) – the data-loading "preview what you're about to train on" touchpoint. More...

#include <image_grid_view.hpp>

Static Public Member Functions

static void Draw (const char *title, const Dataset &dataset, TextureCache &cache, int64_t start_index, int64_t count, int columns=4, float thumbnail_size=96.0f, const std::vector< std::string > *captions=nullptr)
 

Detailed Description

Draws a grid of image samples from a Dataset whose first Sample field is a decoded (1,C,H,W) or (C,H,W) image tensor (e.g. ImageFolderDataset) – the data-loading "preview what you're about to train on" touchpoint.

Note
Deliberately not unit-tested – see AttributionBarChart's note. Pixel-format conversion is plot_data.hpp's ToRgbImageBuffer (unit-tested); this only lays out already-cached GL textures.

Member Function Documentation

◆ Draw()

static void pulsatrix::ImageGridView::Draw ( const char *  title,
const Dataset &  dataset,
TextureCache &  cache,
int64_t  start_index,
int64_t  count,
int  columns = 4,
float  thumbnail_size = 96.0f,
const std::vector< std::string > *  captions = nullptr 
)
static
Parameters
titleA unique ImGui child id for this grid.
datasetA Dataset whose Sample::fields[0] is an image tensor.
cacheTexture cache to upload through – owned by the caller so it persists across frames instead of re-uploading every image every frame.
start_indexFirst sample index to display.
countHow many samples to display, in a fixed-column grid.
columnsNumber of images per row.
thumbnail_sizeDisplayed width/height in pixels per thumbnail.
captionsOptional per-thumbnail caption drawn under each image (e.g. "true 7 / pred 7"); captions[k] labels sample start_index + k. Thumbnails past the end of captions get no caption. nullptr (default) draws images only.

The documentation for this class was generated from the following file: