spacr.qt.widgets.model_card_viewer¶
Viewer for the 3-page model cards of the Model Zoo.
Shows the page image of a card scaled to fit, with Previous and Next, a “1 / 3” counter, Left and Right keys and a link to the model on Hugging Face. The images are fetched on first view in a worker thread and cached; without them the viewer shows the same three pages as text from the card data that ships with spaCR. Clicking the image opens it larger in a dialog.
Classes¶
Page through the card of one model. |
Module Contents¶
- class spacr.qt.widgets.model_card_viewer.ModelCardViewer(parent=None, *, threaded: bool = True, fetch: Callable[[str], bytes] | None = None, enlargeable: bool = True)[source]¶
Bases:
PySide6.QtWidgets.QFramePage through the card of one model.
- Parameters:
parent – parent widget.
threaded – fetch the images on a worker thread;
Falsefetches inline, for tests.fetch – byte source taking a URL, handed to
spacr.model_cards.fetch_pages();Noneuses the network.enlargeable – clicking the image opens a larger dialog.
- go_to(page: int) None[source]¶
Show page
page(zero-based), clamped to the pages.- Parameters:
page – the page index, from 0.