annie.pages.dataset¶
Dataset tab — define the dataset by adding data sources; see live metrics.
Annie is dataset-agnostic: instead of fixed folder fields, you build the dataset
from a list of data sources (the + box). A videos folder is the mandatory
spine; vdet/track folders, a protagonist CSV, and any number of label CSVs
attach to it. There is no Scan button — adding or removing a source re-scans in
place, and every metric and Browse row updates immediately. Each source shows an
Available / Unavailable chip and a live item count.
Each browser tab maintains its own scan-in-progress flag and database-mode
selection via a per-client _DatasetState keyed by
nicegui.Client.id.
Attributes¶
What saving a config should do with the progress in the currently open database. |
Classes¶
One overview metric card on the Dataset tab. |
|
What committing the Layout text boxes should do. |
Functions¶
|
The overview cards that fit the configured sources, as rows (empty rows dropped). |
|
Build and validate a |
|
Decide what to do when the Pattern box is committed (blur / Enter). |
|
Describe what a nested layout found, from the last scan (no extra filesystem walk). |
|
Build the Dataset tab body; register per-client state. |
Module Contents¶
- annie.pages.dataset.CarryAction¶
What saving a config should do with the progress in the currently open database.
- class annie.pages.dataset.MetricCard[source]¶
One overview metric card on the Dataset tab.
- title¶
The card’s caption.
- key¶
The
ScanResult.countskey it shows.
- color¶
The caption colour.
- annie.pages.dataset.metric_rows(registry: annie.dataset.sources.SourceRegistry) list[list[MetricCard]][source]¶
The overview cards that fit the configured sources, as rows (empty rows dropped).
# videosis always shown; vdet and track cards appear only once that folder is a source, so a plain video dataset is not cluttered with face-tracking counts.- Parameters:
registry – The configured sources.
- Returns:
file counts first, then per-video coverage.
- Return type:
Rows of cards
- class annie.pages.dataset.LayoutCommit[source]¶
What committing the Layout text boxes should do.
- layout¶
The valid layout to apply, or
Nonewhen there is nothing to apply.
- error¶
A user-readable validation message, or
None.
- annie.pages.dataset.layout_from_input(pattern: str) annie.dataset.layout.VideoLayout[source]¶
Build and validate a
VideoLayoutfrom the Pattern box.- Parameters:
pattern – The pattern box (path relative to the folder, with
{field}placeholders).- Returns:
The validated layout.
- Raises:
ValueError – With a user-readable message if the layout is unusable.
- annie.pages.dataset.layout_commit(pattern: str, current: annie.dataset.layout.VideoLayout | None) LayoutCommit[source]¶
Decide what to do when the Pattern box is committed (blur / Enter).
- Parameters:
pattern – The pattern box text.
current – The layout already applied to the source, if any.
- Returns:
LayoutCommit(layout=...)to apply a new valid layout;LayoutCommit(error=...)for an invalid one (nothing is applied); an emptyLayoutCommit()when the box still describes the applied layout, or is still empty (nothing to do yet).
- annie.pages.dataset.layout_summary(source: annie.dataset.sources.DataSource, scan: annie.dataset.scanning.ScanResult | None) str | None[source]¶
Describe what a nested layout found, from the last scan (no extra filesystem walk).
- Parameters:
source – The Videos-folder source.
scan – The last scan result.
- Returns:
A one-line summary such as
"278 videos · a ×70 · b ×4 · 0 collisions · e.g. …", orNonewhen the source has no layout or nothing was scanned.