# How to log a table of media to artifacts

**URL:** <https://community.wandb.ai/t/how-to-log-a-table-of-media-to-artifacts/4377>\
**Category:** W&B Help\
**Created:** [May 11, 2023, 8:53am UTC](https://community.wandb.ai/t/how-to-log-a-table-of-media-to-artifacts/4377 "2023-05-11T08:53:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![markstent](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@markstent](https://community.wandb.ai/u/markstent)\
**Post date:** [May 11, 2023, 8:53am UTC](https://community.wandb.ai/t/how-to-log-a-table-of-media-to-artifacts/4377/1 "2023-05-11T08:53:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [May 13, 2023, 2:42am UTC](https://community.wandb.ai/t/how-to-log-a-table-of-media-to-artifacts/4377/2 "2023-05-13T02:42:09Z")

</div>

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](https://docs.wandb.ai/guides/app/features/panels/weave#creating-weave-panels). 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](https://wandb.ai/mohammadbakir/nature_photos/artifacts/run_table/run-1z5qqesz-test_results/v0/files)

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

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [May 18, 2023, 5:34pm UTC](https://community.wandb.ai/t/how-to-log-a-table-of-media-to-artifacts/4377/3 "2023-05-18T17:34:43Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [July 17, 2023, 5:35pm UTC](https://community.wandb.ai/t/how-to-log-a-table-of-media-to-artifacts/4377/4 "2023-07-17T17:35:03Z")

</div>

Closed on July 17, 2023, 5:35pm UTC

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