# Table with images much larger than originals

**URL:** <https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018>\
**Category:** W&B Help\
**Tags:** artifacts, tables\
**Created:** [March 7, 2023, 4:32pm UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018 "2023-03-07T16:32:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommasodelorenzo](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tommasodelorenzo](https://community.wandb.ai/u/tommasodelorenzo)\
**Post date:** [March 7, 2023, 4:32pm UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/1 "2023-03-07T16:32:24Z")

</div>

I am uploading images to artifact by loading a table with an `image` column, as shown in lesson 1 of your mlops course. However, if I create the image values as `wandb.Image(PIL.Image.open(path))` , my 3GB image folder becomes \>30Gb `media/images` folder in the artifact. If instead I use `wandb.Image(path)` , the artifact’s `media/images` folder is about 3GB, but each image is loaded into a subfolder with a random name, making difficult to retrieve the image when I download the artifact for training. How can I have the images loaded simply into `media/images`, with the latter not being enormously bigger than the original one?

---

<div class="post-metadata">

**Author:** ![bill-morrisson](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@bill-morrisson](https://community.wandb.ai/u/bill-morrisson)\
**Post date:** [March 9, 2023, 11:15pm UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/2 "2023-03-09T23:15:42Z")

</div>

Hello Tommaso, thank you for contacting us and sorry this is happening to you.  
Could you please let me know you wandb client version number and also the exact snippet of code you used to try to upload the artifact which resulted in the 30Gb folder?

---

<div class="post-metadata">

**Author:** ![tommasodelorenzo](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tommasodelorenzo](https://community.wandb.ai/u/tommasodelorenzo)\
**Post date:** [March 12, 2023, 1:33pm UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/3 "2023-03-12T13:33:21Z")

</div>

`wandb version 0.13.10`

Here is the snippet

```auto
def _create_table(df):
    "Create a wandb table given the input df"
    table = wandb.Table(columns=["filename", "image", "card_name", "set_name", "stage", "baseline_stage"])
    
    for _index, _row in tqdm(df.iterrows(), total=df.shape[0]):
        table.add_data(
            _row.filename,
            wandb.Image( PIL.Image.open(_row.filename) ),
            _row.card_name,
            _row.set_name,
            "None", # we don't have a dataset split yet
            _row.baseline_stage
        )
    
    return table

```

I also tried to convert the PIL image to array with no success in reducing the size `wand.Image( np.asarray(PIL.image.open(_row.filename)))`

---

<div class="post-metadata">

**Author:** ![tommasodelorenzo](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tommasodelorenzo](https://community.wandb.ai/u/tommasodelorenzo)\
**Post date:** [March 14, 2023, 7:13pm UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/4 "2023-03-14T19:13:03Z")

</div>

@bill-morrisson Any idea? Thanks

---

<div class="post-metadata">

**Author:** ![bill-morrisson](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@bill-morrisson](https://community.wandb.ai/u/bill-morrisson)\
**Post date:** [March 15, 2023, 2:40pm UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/5 "2023-03-15T14:40:41Z")

</div>

Hello @tommaso let me look into it today and get back to you.

---

<div class="post-metadata">

**Author:** ![tommasodelorenzo](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tommasodelorenzo](https://community.wandb.ai/u/tommasodelorenzo)\
**Post date:** [March 17, 2023, 8:26am UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/6 "2023-03-17T08:26:22Z")

</div>

I have also tried to log the images with `img = artifact.add_file(filepath)` and add `img.path` to a column of the table, but the image is not rendered in wandb UI

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [April 5, 2023, 8:47pm UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/7 "2023-04-05T20:47:39Z")

</div>

Hey Tommaso, could you send a link to your workspace here where you are uploading the artifacts?

What happens is wandb.Image(PIL.Image.open(path)) uploads a full PIL object with cache and because of that it takes up a loot more space than using wandb.Image(path) because that one just simply uploads an image.

From my understanding, when you do use PIL.Image.open(path) you get the desired folder right?

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [April 11, 2023, 3:46pm UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/8 "2023-04-11T15:46:32Z")

</div>

Hi Tommaso,

We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.

Best,  
Weights & Biases

---

<div class="post-metadata">

**Author:** ![artsiom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/artsiom/32/1001_2.png) [@artsiom](https://community.wandb.ai/u/artsiom)\
**Post date:** [April 14, 2023, 5:04pm UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/9 "2023-04-14T17:04:01Z")

</div>

Hi Tommaso, 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:** [May 16, 2023, 8:26am UTC](https://community.wandb.ai/t/table-with-images-much-larger-than-originals/4018/10 "2023-05-16T08:26:38Z")

</div>

Closed on May 16, 2023, 8:26am UTC

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