MCPcopy Create free account
hub / github.com/NVIDIA/DALI / compare_videos

Function compare_videos

dali/test/python/decoder/test_video.py:166–178  ·  view source on GitHub ↗
(reference, actual)

Source from the content-addressed store, hash-verified

164
165
166def compare_videos(reference, actual):
167 try:
168 np.testing.assert_array_equal(reference, actual)
169 except AssertionError:
170 # Save frames as PNG files for debugging
171 print("Videos don't match - saving frames as PNG files for debugging...")
172 for i, (ref_frame, act_frame) in enumerate(zip(reference, actual)):
173 ref_filename = f"reference_frame_{i}.png"
174 act_filename = f"actual_frame_{i}.png"
175 cv2.imwrite(ref_filename, ref_frame)
176 cv2.imwrite(act_filename, act_frame)
177 print(f"Saved frame {i} to {ref_filename} and {act_filename}")
178 raise
179
180
181@pipeline_def(device_id=0)

Calls 1

printFunction · 0.85

Tested by

no test coverage detected