Skip to content

Instantly share code, notes, and snippets.

@morganmcg1
Created March 8, 2022 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morganmcg1/317f89c98db0f59953087c0614859883 to your computer and use it in GitHub Desktop.
Save morganmcg1/317f89c98db0f59953087c0614859883 to your computer and use it in GitHub Desktop.
Logging images to Tables with references
# First table/ table for first iteration/epoch
original_table = ... # format [id, wandb.Image object, ...]
artifact.add(original_table, "my_table")
# Log the table as artifact. (optionally)Log the same table in dashboard if you want to
run.log_artifact(artifact)
run.log({"my_table": original_table})
# Use the logged artifact to get the reference of table
run.use_artifact(artifact)
artifact.wait()
table_ref = artifact.get('my_table')
# Construct new table images from the reference of the original table
for i in epoch:
table = ...
table.add(id, wandb.Image(table_ref[index][1], boxes=boxes, classes=class_set))
artifact.add(table, "my_table")
wandb.log_artifact(artifact)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment