DALI icon indicating copy to clipboard operation
DALI copied to clipboard

Can dali webdataset reader work out classes from folder structure?

Open Data-drone opened this issue 3 years ago • 3 comments

The webdataset reader seems to require a file to define the class per image in a tar? As shown in this example: https://docs.nvidia.com/deeplearning/dali/user-guide/docs/examples/general/data_loading/dataloading_webdataset.html

The standard nvidia.dali.fn.readers.file can work out the class from the folder structure as per: https://docs.nvidia.com/deeplearning/dali/user-guide/docs/operations/nvidia.dali.fn.readers.file.html

Is it possible to get derive the label for a file from the folder that it is in with webdataset or do I need to add an extra file per sample for the class?

Data-drone avatar Aug 07 '22 14:08 Data-drone

Hi, @Data-drone,

The file reader operator reads single files, while the webdataset is a container. You can read more about it here. The class is just one of the data kinds it can house there is no connection between the class itself and the file, as each file can house multiple samples.

JanuszL avatar Aug 07 '22 21:08 JanuszL

In that case when I use nvidia.dali.fn.readers.file can I get the filename as an object back out of it to use elsewhere?

Data-drone avatar Aug 08 '22 12:08 Data-drone

Hi, @Data-drone,

You can use the get_property operator. As an example you can check this test file.

JanuszL avatar Aug 08 '22 21:08 JanuszL