NVIDIA / DALI

A GPU-accelerated library containing highly optimized building blocks and an execution engine for data processing to accelerate deep learning training and inference applications.
https://docs.nvidia.com/deeplearning/dali/user-guide/docs/index.html
Apache License 2.0
5.12k stars 619 forks source link

Support for Numpy labels with VideoReader #2296

Open Timen opened 4 years ago

Timen commented 4 years ago

It might be that I missed some instruction however I don't currently see a way to train with videos using the VideoReader but supply the labels as a npy array. Is this functionality supported at all? The VideoReader seems perfect for training with video data but if it only support classification labels that would severely limit the use-fullness of it.

JanuszL commented 4 years ago

Hi, It is not currently possible to do that directly. However, you can assign a custom label to any range of frames in the video using file_list in the VideoReader operator. If you assign a custom and unique label you can easily map it to the desired numpy array that you would load outside DALI.

Timen commented 4 years ago

@JanuszL I hadn't thought about that workaround, that is a good suggestion! It would still be nice to have it in one place but I can use a per frame index as a lookup in my label table.