lidq92 / MDTVSFA

[official] Unified Quality Assessment of In-the-Wild Videos with Mixed Datasets Training (IJCV 2021)
MIT License
83 stars 16 forks source link

skvideo OR opencv? #4

Closed ciwei123 closed 3 years ago

ciwei123 commented 3 years ago

@lidq92 Thanks for your sharing.

  1. I find that the "skvideo.io.vread" is used in the project. And I want to know if it extract three channels or one channel when the video format is YUV420p.
  2. And I find it faster to extract video frames using opencv, why did you choose "skvideo.io.vread"? There is a little bit of difference between "skvideo.io.vread" and "opencv"(0.47704992 VS 0.47492328 ).
  3. I don't know the meaning of the frame = Image.fromarray(frame), because when I remove this code ,I still get the same result.

Thank you very much!!

lidq92 commented 3 years ago

@ciwei123

  1. Three if using the default as_grey=False. See skvideo.io.vread for more details.
  2. No preference between skvideo and opencv. There may be a little difference between the implementations of the two packages. You should make sure that you always use the same package to read videos in the same project.
  3. Some transforms need the PIL-like inputs, so I just use Image.fromarray to satisfy them. The reason for no effect found when removing the code is because the first transform in my code is ToTensor(), and it supports both PIL Image and numpy.ndarray. See ToTensor for more details.