Image Logging De-Duplication
In this guide, you will learn how to upload an image to W&B once, even while logging the image across multiple runs!
wandb.init()
art = wandb.Artifact("my_images", "dataset")
for path in IMAGE_PATHS:
art.add(wandb.Image(path), path)
wandb.log_artifact(art)
The
img_1
object is a wandb.Image
which retains a reference to its source artifact. Logging it to a run (or another artifact) will avoid re-uploading the image data and instead store a reference to the original source.wandb.init()
art = wandb.use_artifact("my_images:latest")
img_1 = art.get(PATH)
wandb.log({"image": img_1})
Last modified 7mo ago