NVIDIA / NVIDIA/DALI

readers.video hang on reading avi files

Open
#3,825 1 comment 0 reactions 1 assignee View on GitHub

@prak-nv is already working on this.

Since Apr 15, 2022.

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

Description

Hi, I am using DALI on NTU RGB D dataset, and for some reasons, my code hangs when reading the avi files, similar to @3312. In @3312 it seems that this issue is related to VFR. But I see that there is a flag skip_vfr_check, so I guess now VFR functionality is already incorporated?
My code is

@pipeline_def
def get_dali_pipeline(crop_size):
    
    data_dir = "/home/ICT2000/jxu/Multimodal-Transformer/data/data/NTU RGB+D/nturgb+d_rgb"
    csv_dir = "/home/ICT2000/jxu/Multimodal-Transformer/data/datasets/NTU RGB+D"
    df = pd.read_csv(f"{csv_dir}/post_val.csv")
    files, labels = (data_dir + "/" + df["path"]).tolist(), df["label"].tolist()

    images = fn.readers.video(
        device="gpu", filenames=files, random_shuffle=False, sequence_length=8,
        name="Reader", dtype=types.UINT8, pad_last_batch=True, image_type=types.RGB,)
    images = fn.crop(images, crop=crop_size, dtype=types.FLOAT,
                     crop_pos_x=fn.random.uniform(range=(0.0, 1.0)),
                     crop_pos_y=fn.random.uniform(range=(0.0, 1.0)))
    images = fn.transpose(images, perm=[3, 0, 1, 2])

    
    return images

pipeline = get_dali_pipeline(
                    num_threads=1,
                    batch_size=4,
                    crop_size=224)
pipeline.build()
train_data = DALIGenericIterator(
    pipeline, ["data"],
   reader_name='Reader', auto_reset=True,
)


for i, data in enumerate(train_data):
  x = data[0]['data']

Please let me know if I made some mistakes in my code. Thanks!

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.