![]() ![]() ![]() ![]() Of = fn.optical_flow(video, output_format=4, preset=of_presets, enable_temporal_hints=True) Video_bgr = fn.color_space_conversion(video, image_type=, output_type=) # gray = fn.color_space_conversion(video, image_type=, output_type=) Skip_vfr_check=True, pad_sequences=True, name="Reader", file_list_include_preceding_frame=True) Shard_id=0, num_shards=1, random_shuffle=False, initial_fill=batch_size, Video = fn.(device="gpu", filenames=filename, sequence_length=sequence_length, :return A tuple of the decoded video frames (shape: ) and optical flow frames (shape: ) :param preset: The speed and quality level of the optical flow calculations :param grid_size: Height & width of the calculated optical flow are divided by grid_size, mostly used for optimization. :param sequence_length: The number of frames returned per batch of decoding (if video length % sequence_length != 0, it will return duplicate / repeated frames, so make sure to filter these away after decoding) :param filename: Filename of the video file that should be decoded :param goal_shape: Goal shape of the optical flow frames :param with_of: Whether the video pipe should also return optical flow Pipeline that decodes a single video & simultaneously calculates the optical flow "fast": video_pipe(filename: str, sequence_length: int, with_of: bool, goal_shape: (int, int), preset: str = "slow"): # Nvidia OF presets that determine the speed/quality trade-off of the output optical flow Source code of my current video decoding pipeline: import numpy as np Many thanks in advance!ĮDIT: As a follow-up question, would there be a difference in using RGB (or BGR) video frames instead of grayscale video frames in the resulting optical flow frames? For instance, some of OpenCV’s OF implementations require you to convert your input to grayscale, while DALI also allows RGB video frames. I hope switching to a different file type is not necessary, as I will be expecting. Does the generated optical flow quality depend this strongly on the input video type? If so, what would be the most ideal video type to use to generate high-quality optical flow, or how can I improve the quality of the returned optical flow frames? I was wondering what the cause of difference in quality is. webm format and the calculated optical flow output below:Īs you can see, the generated flow output differs highly between the two file formats & both results contain quite a lot of noise. I have provided my sample input video I converted to. I have noticed the quality of the returned optical flow highly differs based on the input video type. I had some questions I asked the DALI devs, but was redirected to this forum ( original issue). My video decoding pipeline is very similar to the examples provided by the DALI docs. I make use of Nvidia DALI to decompress videos and to calculate optical flow between video frames. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |