diff --git a/dali/operators/reader/video_reader_decoder_op_test.cc b/dali/operators/reader/video_reader_decoder_op_test.cc index 6112fc1aafe..89d412963a0 100644 --- a/dali/operators/reader/video_reader_decoder_op_test.cc +++ b/dali/operators/reader/video_reader_decoder_op_test.cc @@ -124,18 +124,23 @@ class VideoReaderDecoderBaseTest : public VideoTestBase { auto &ground_truth_video = cfr_videos_[0]; Pipeline pipe(batch_size, 1, device_id, seed); + std::vector labels(cfr_videos_[0].NumFrames()); + std::iota(a.begin(), a.end(), 1); pipe.AddOperator(OpSpec("experimental__readers__Video") .AddArg("device", backend) .AddArg("sequence_length", sequence_length) .AddArg("random_shuffle", true) .AddArg("initial_fill", cfr_videos_[0].NumFrames()) + .AddArg( + "labels", labels) .AddArg( "filenames", std::vector{cfr_videos_paths_[0]}) - .AddOutput("frames", backend)); + .AddOutput("frames", backend) + .AddOutput("frame_labels", backend)); - pipe.Build({{"frames", backend}}); + pipe.Build({{"frames", backend}, {"frame_labels", backend}}); // ToFix std::vector expected_order = {29, 46, 33, 6, 37}; @@ -148,7 +153,12 @@ class VideoReaderDecoderBaseTest : public VideoTestBase { pipe.Outputs(&ws); auto &frame_video_output = ws.Output(0); + auto &cpu_label_output = ws.Output(0); + const auto cpu_label = cpu_label_output.tensor(sample_id); + int label_buffer = -1; + MemCopy(&label_buffer, cpu_label, sizeof(int)); + std::cout << " labels " << label_buffer << " vs " << expected_order[sequence_id], // We want to access correct order, so we compare only the first frame of the sequence AssertFrame(expected_order[sequence_id], sample, ground_truth_video);