NVIDIA / NVIDIA/DALI

Image Segmentation mask aliasing

Open
#5,507 3 comments 0 reactions 1 assignee View on GitHub

@JanuszL is already working on this.

Since Jun 7, 2024.

question
Dominant language
C++
Stars
5.8k
Forks
678
Avg merge
3d 1h
Merged PRs (30d)
27

Description

Describe the question.

Thanks for this work.

I have a pipeline for training image segmentation modes. I am using albumentations library for data augmentations.
Now it is time for me to try DALI to get a speed boost.

I need to load the images and corresponding masks and train a model using augmented images and masks.
However, I noticed when I Ioad the masks using the following lines the aliasing happens and new pixel values appear in the mask. In other words, the pixel value in the mask frame should be only a certain number such as 0, 25, 100, 220. But after operations such as fn.resize or fn.random_resized_crop values in between them appear.

    image_files, _= fn.readers.file(file_root=str(images_dir), file_filters='*.png', seed=1234, name="main_reader")#, num_shards=world_size, shard_id=global_rank)
    mask_files, _= fn.readers.file(file_root=str(mask_dir), seed=1234)

    images = fn.random_resized_crop(images, size = (512,512), random_area=[0.08, 1.0], 
                                    random_aspect_ratio=[0.75, 1.333333],antialias=True)

Before resize:
image

After resize:
image

So how can I avoid this?

Check for duplicates
  • I have searched the open bugs/issues and have found no duplicates for this bug report

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.