Created
March 8, 2022 18:54
-
-
Save morganmcg1/317f89c98db0f59953087c0614859883 to your computer and use it in GitHub Desktop.
Logging images to Tables with references
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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