Skip to contents

Prints a human-readable model card for a trained segmentation model and returns the card contents as a tibble.

Usage

sg_model_card(trained_model)

Arguments

trained_model

An sg_trained_model object.

Value

A tibble with columns field and value representing the model card contents, returned invisibly.

Examples

# a dedicated directory with a stand-in weight file
weights <- file.path(tempfile("model"), "cellpose_weights")
dir.create(dirname(weights))
writeBin(as.raw(1:16), weights)
mdl <- new_sg_trained_model(
  model_path = weights,
  backend = "cellpose",
  base_model = "cyto3",
  training_metrics = list(n_epochs = 100L),
  model_card = list(author = "Test User", tissue = "lung")
)
sg_model_card(mdl)
#> ── Model Card ──────────────────────────────────────────────────────────────────
#> Backend: cellpose
#> Base Model: cyto3
#> Model Path: /tmp/RtmpZNYdOa/model1f6cd68d5c8/cellpose_weights
#> Created: 2026-11-22 06:25:10
#> Metric: n_epochs: 100
#> author: Test User
#> tissue: lung
#> ────────────────────────────────────────────────────────────────────────────────