(device)
| 344 | |
| 345 | @params("cpu", "gpu") |
| 346 | def test_source_info(device): |
| 347 | skip_if_m60() |
| 348 | filenames = glob.glob(f"{get_dali_extra_path()}/db/video/[cv]fr/*.mp4") |
| 349 | # filter out HEVC because some GPUs do not support it |
| 350 | filenames = filter(lambda filename: "hevc" not in filename, filenames) |
| 351 | # filter out AV1 because some GPUs do not support it |
| 352 | filenames = filter(lambda filename: "av1" not in filename, filenames) |
| 353 | if device == "cpu": |
| 354 | # some formats are not yet supported in the CPU operator itself |
| 355 | filenames = filter(lambda filename: "mpeg4" not in filename, filenames) |
| 356 | excluded = {"test_1.mp4", "test_2.mp4"} |
| 357 | filenames = filter(lambda f: os.path.basename(f) not in excluded, filenames) |
| 358 | |
| 359 | files = list(filenames) |
| 360 | |
| 361 | @pipeline_def |
| 362 | def test_pipeline(): |
| 363 | videos = fn.experimental.readers.video( |
| 364 | device=device, |
| 365 | filenames=files, |
| 366 | sequence_length=1, |
| 367 | step=10000000, # make sure that each video has only one valid sequence |
| 368 | ) |
| 369 | return videos |
| 370 | |
| 371 | batch_size = 4 |
| 372 | device_id = None if device == "cpu" else 0 |
| 373 | p = test_pipeline(batch_size=batch_size, num_threads=1, device_id=device_id) |
| 374 | |
| 375 | samples_read = 0 |
| 376 | while samples_read < len(files): |
| 377 | o = p.run() |
| 378 | for idx, t in enumerate(o[0]): |
| 379 | assert t.source_info() == files[(samples_read + idx) % len(files)] |
| 380 | samples_read += batch_size |
| 381 | |
| 382 | |
| 383 | @params("cpu", "mixed") |
nothing calls this directly
no test coverage detected