Esacode

Docs / Blocks / Processing

Image previews

Small previews of the images to look at (the flagged ones, a sample of the rest), with what the tables say about each, for a Review grid.

Runs on a worker (Python) Processing Version 1.0 Code you can open and adapt

How it works

The images stay on the worker; a View can only show what reaches EsaSim, and that is at most 200 files and 25 MB a run. This block makes small JPEG previews (Size, longest side), packed a few hundred to a file, together with what the connected tables say about each image: its label, flags and reasons, duplicate group and the image kept, suggested label, scores.

Connect the flag tables of Image quality check, Find duplicates and Check labels (or the Removed table of Curate and split), and a Review grid to look at them. Show: the flagged images (any row with a flag), every image the tables list, or all images; plus a random sample of images with no flag, to check what is kept too. For duplicates, the image kept of each group comes along, to compare. Runs on any worker.

Inputs

InputTakesWhat it is
Images
images
Files
jpg, jpeg, png, webp, bmp, tif
The images, in folders (the folder is the label) Takes several connections.
About the images
tables
Table
csv, tsv
Tables with a path column: quality.csv, duplicates.csv, label_check.csv, removed.csv, zero_shot.csv… Optional. Takes several connections.

Outputs

OutputGivesWhat it is
Previews
previews
Files
json
previews-001.json…: {kind: esasim.previews/1, items: [{path, name, label, status, flags, reasons, image (a data: URL), width, height, fields}]}, up to 4 MB each
Live telemetry
telemetry
Live telemetryWhat the block sends while it runs, for views such as Chart or 3D view.

Settings

SettingDefaultWhat it does
Show
show
flagged flagged: images with a flag in a table · listed: every image the tables name · all: every image
One of: flagged, listed, all
Plus a sample with no flag
sample_ok
48 Images with no flag, chosen at random, to check what is kept too; 0: none
From 0 to 2000
Size (px)
size
256 Longest side of each preview
From 64 to 640
Most previews
max
600 The flagged images come first; a run keeps up to about 20 MB of previews on EsaSim
From 1 to 3000
Seed
seed
1 The same seed gives the same sample

Where it runs

On one of your computers with the EsaSim worker: Any worker. The worker installs the Python packages it needs when they are missing: pillow.

In its code, settings are ctx.params["key"], inputs ctx.inputs["id"] and outputs ctx.output("id", "name.ext"); see Custom blocks.

More in Processing