How to log a table of media to artifacts

I am busy with an audio generation diffusion project and would like to save and image and an audio file every epoch and track their evolving as artifacts, here is my current code:

Log media table

            wandb_table_media = wandb.Table(
                    columns=['Epoch', 'Step', 'Clean-Images', 
                             'Generated-Mel-Images', 'Generated-Audio'])
            img_shape = np.reshape(images[0], (1, 256, 256))
            wandb_table_media.add_data(
                epoch, 
                global_step, wandb.Image(clean_images[0]),
                wandb.Image(img_shape),
                wandb.Audio(normalize(audios[0]), sample_rate=sample_rate))
            wandb.log({'wandb_table_media': wandb_table_media})
            
        # Log media artifact
        
            media_artifact = wandb.Artifact(
                f'media-table-{args.project_name}',
                type='table',
                description='media-table'
                )
            media_artifact.add(wandb_table_media, "media-table-sonic-diffusion")
            wandb.log_artifact(media_artifact,
                               aliases=[f'step_{global_step}', f'epoch_{epoch}'])

It logs the table artifact fine in WANDB…how do i create a table in WANDB to view these images and audio files?

Hi @markstent , happy to help. If you logged a table as an artifact you can view this table in the workspace using a weave panel. After creating the panel, use the following weave query to view your artifact table.

project.artifact("artifact-name").versions.file("artifact-file-name"),

example of this for this artifact

project.artifact("run-1z5qqesz-test_results").versions.file("test_results.table.json")

Hi @markstent , since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.